diff --git a/public/fonts/item-count.png b/public/fonts/item-count.png new file mode 100644 index 00000000000..85cfe88e902 Binary files /dev/null and b/public/fonts/item-count.png differ diff --git a/public/fonts/item-count.xml b/public/fonts/item-count.xml new file mode 100644 index 00000000000..351354824ca --- /dev/null +++ b/public/fonts/item-count.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/loading-scene.ts b/src/loading-scene.ts index c59a0224d58..5c8f879ebce 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -129,6 +129,9 @@ export class LoadingScene extends SceneBase { } }); + // Load bitmap fonts + this.load.bitmapFont('item-count', 'fonts/item-count.png', 'fonts/item-count.xml'); + // Load trainer images this.loadAtlas('trainer_m_back', 'trainer'); this.loadAtlas('trainer_m_back_pb', 'trainer'); diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 50f64c403e9..5c7d57ac974 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -183,26 +183,14 @@ export abstract class PersistentModifier extends Modifier { return container; } - getIconStackText(scene: BattleScene, virtual?: boolean): Phaser.GameObjects.Text { + getIconStackText(scene: BattleScene, virtual?: boolean): Phaser.GameObjects.BitmapText { if (this.getMaxStackCount(scene) === 1 || (virtual && !this.virtualStackCount)) return null; - const isStackMax = this.getStackCount() >= this.getMaxStackCount(scene); - const maxColor = '#f89890'; - const maxStrokeColor = '#984038'; - - if (virtual) { - const virtualText = addTextObject(scene, 27, 12, `+${this.virtualStackCount.toString()}`, TextStyle.PARTY, { fontSize: '66px', color: !isStackMax ? '#40c8f8' : maxColor }); - virtualText.setShadow(0, 0, null); - virtualText.setStroke(!isStackMax ? '#006090' : maxStrokeColor, 16) - virtualText.setOrigin(1, 0); - - return virtualText; - } - - const text = addTextObject(scene, 8, 12, this.stackCount.toString(), TextStyle.PARTY, { fontSize: '66px', color: !isStackMax ? '#f8f8f8' : maxColor }); - text.setShadow(0, 0, null); - text.setStroke('#424242', 16); + const text = scene.add.bitmapText(10, 15, 'item-count', this.stackCount.toString(), 11); + text.letterSpacing = -0.5; + if (this.getStackCount() >= this.getMaxStackCount(scene)) + text.setTint(0xf89890) text.setOrigin(0, 0); return text;