feat(assets): use single texture atlas instead of loading all images individually

This commit is contained in:
2026-01-08 19:55:43 +01:00
parent c6d5911b7d
commit e2d40a4bc1
41 changed files with 488 additions and 377 deletions

View File

@@ -3,14 +3,16 @@ const props = defineProps<{
x: number;
y: number;
opacity: number;
image: HTMLImageElement;
image: {
draw: (ctx: CanvasRenderingContext2D, x: number, y: number) => void;
};
}>();
const { onRender } = useScreen();
onRender((ctx) => {
ctx.globalAlpha = props.opacity;
ctx.drawImage(props.image, props.x, props.y);
props.image.draw(ctx, props.x, props.y);
});
defineOptions({