feat(assets): use single texture atlas instead of loading all images individually
This commit is contained in:
@@ -6,8 +6,8 @@ const { onRender } = useScreen();
|
||||
const { assets } = useAssets();
|
||||
const confirmationModal = useConfirmationModal();
|
||||
|
||||
const BG_WIDTH = assets.common.confirmationModal.width;
|
||||
const BG_HEIGHT = assets.common.confirmationModal.height;
|
||||
const BG_WIDTH = assets.images.common.confirmationModal.rect.width;
|
||||
const BG_HEIGHT = assets.images.common.confirmationModal.rect.height;
|
||||
const BG_X = Math.floor((SCREEN_WIDTH - BG_WIDTH) / 2);
|
||||
const BG_Y = Math.floor((SCREEN_HEIGHT - BG_HEIGHT) / 2);
|
||||
|
||||
@@ -34,7 +34,7 @@ onRender((ctx) => {
|
||||
|
||||
ctx.translate(0, confirmationModal.offsetY);
|
||||
|
||||
ctx.drawImage(assets.common.confirmationModal, BG_X, BG_Y);
|
||||
assets.images.common.confirmationModal.draw(ctx, BG_X, BG_Y);
|
||||
|
||||
ctx.font = "16px Pokemon DP Pro";
|
||||
ctx.textBaseline = "top";
|
||||
|
||||
Reference in New Issue
Block a user