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