feat(assets): use single texture atlas instead of loading all images individually
This commit is contained in:
@@ -5,12 +5,12 @@ const store = useContactStore();
|
||||
const { assets } = useAssets();
|
||||
|
||||
onRender((ctx) => {
|
||||
ctx.drawImage(assets.home.topScreen.background, 0, 0);
|
||||
assets.images.home.topScreen.background.draw(ctx, 0, 0);
|
||||
ctx.globalAlpha = store.isIntro
|
||||
? store.intro.stage2Opacity
|
||||
: store.outro.stage3Opacity;
|
||||
|
||||
ctx.drawImage(assets.contact.topScreen.background, 0, 0);
|
||||
assets.images.contact.topScreen.background.draw(ctx, 0, 0);
|
||||
});
|
||||
|
||||
defineOptions({
|
||||
|
||||
@@ -8,12 +8,12 @@ onRender((ctx) => {
|
||||
ctx.globalAlpha = store.isIntro
|
||||
? store.intro.stage1Opacity
|
||||
: store.outro.stage2Opacity;
|
||||
ctx.drawImage(assets.contact.topScreen.leftBar, 0, 0);
|
||||
assets.images.contact.topScreen.leftBar.draw(ctx, 0, 0);
|
||||
|
||||
ctx.globalAlpha = store.isIntro
|
||||
? store.intro.stage3Opacity
|
||||
: store.outro.stage1Opacity;
|
||||
ctx.drawImage(assets.contact.topScreen.leftBarThings, 0, 0);
|
||||
assets.images.contact.topScreen.leftBarThings.draw(ctx, 0, 0);
|
||||
});
|
||||
|
||||
defineOptions({
|
||||
|
||||
@@ -15,7 +15,7 @@ onRender((ctx) => {
|
||||
const y = 169 - 24 * index + store.notificationsYOffset;
|
||||
if (y < -24) break;
|
||||
|
||||
ctx.drawImage(assets.contact.bottomScreen.notification, 21, y);
|
||||
assets.images.contact.bottomScreen.notification.draw(ctx, 21, y);
|
||||
|
||||
const content = store.notifications[i]!;
|
||||
ctx.fillStyle = content.includes("opened") ? "#00fbba" : "#e3f300";
|
||||
@@ -26,8 +26,8 @@ onRender((ctx) => {
|
||||
ctx.globalAlpha = store.isIntro
|
||||
? store.intro.stage1Opacity
|
||||
: store.outro.stage2Opacity;
|
||||
ctx.drawImage(
|
||||
assets.contact.topScreen.title,
|
||||
assets.images.contact.topScreen.title.draw(
|
||||
ctx,
|
||||
21,
|
||||
store.isIntro
|
||||
? store.intro.titleY
|
||||
|
||||
Reference in New Issue
Block a user