feat(assets): use single texture atlas instead of loading all images individually
This commit is contained in:
@@ -33,27 +33,27 @@ onRender((ctx) => {
|
||||
ctx.translate(props.x, props.y);
|
||||
|
||||
if (isOpen.value || animation.playing) {
|
||||
ctx.drawImage(
|
||||
assets.settings.topScreen.clock.time,
|
||||
assets.images.settings.topScreen.clock.time.draw(
|
||||
ctx,
|
||||
48 - animation.stage2Offset,
|
||||
-48 + animation.stage1Offset,
|
||||
);
|
||||
ctx.drawImage(
|
||||
assets.settings.topScreen.clock.date,
|
||||
assets.images.settings.topScreen.clock.date.draw(
|
||||
ctx,
|
||||
0,
|
||||
-96 + animation.stage2Offset + animation.stage1Offset,
|
||||
);
|
||||
ctx.drawImage(
|
||||
assets.settings.topScreen.clock.alarm,
|
||||
assets.images.settings.topScreen.clock.alarm.draw(
|
||||
ctx,
|
||||
0,
|
||||
-48 + animation.stage1Offset,
|
||||
);
|
||||
|
||||
ctx.drawImage(assets.settings.topScreen.clock.clockActive, 0, 0);
|
||||
assets.images.settings.topScreen.clock.clockActive.draw(ctx, 0, 0);
|
||||
} else if (isAnyOtherMenuOpen.value) {
|
||||
ctx.drawImage(assets.settings.topScreen.clock.clockDisabled, 0, 0);
|
||||
assets.images.settings.topScreen.clock.clockDisabled.draw(ctx, 0, 0);
|
||||
} else {
|
||||
ctx.drawImage(assets.settings.topScreen.clock.clock, 0, 0);
|
||||
assets.images.settings.topScreen.clock.clock.draw(ctx, 0, 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user