Add tactical battle UI icons

This commit is contained in:
2026-06-29 13:33:47 +09:00
parent f7670a1ed1
commit 52612b498c
4 changed files with 796 additions and 58 deletions

View File

@@ -0,0 +1,57 @@
import Phaser from 'phaser';
import battleUiIconsUrl from '../../assets/images/ui/battle-ui-icons.png';
export const battleUiIconTextureKey = 'battle-ui-icons';
export const battleUiIconFrameSize = 48;
export const battleUiIconFrames = {
hp: 0,
might: 1,
intelligence: 2,
leadership: 3,
attack: 4,
defense: 5,
move: 6,
mastery: 7,
sword: 8,
spear: 9,
axe: 10,
bow: 11,
strategy: 12,
horse: 13,
armor: 14,
accessory: 15,
hit: 16,
critical: 17,
terrain: 18,
counter: 19,
advantage: 20,
success: 21
} as const;
export type BattleUiIconKey = keyof typeof battleUiIconFrames;
export const battleUiIconManifest = {
source: 'src/assets/images/ui/battle-ui-icons.png',
textureKey: battleUiIconTextureKey,
frameWidth: battleUiIconFrameSize,
frameHeight: battleUiIconFrameSize,
columns: 5,
rows: 5,
frames: battleUiIconFrames
} as const;
export function loadBattleUiIcons(scene: Phaser.Scene, onReady: () => void) {
if (scene.textures.exists(battleUiIconTextureKey)) {
onReady();
return;
}
scene.load.once('complete', onReady);
scene.load.spritesheet(battleUiIconTextureKey, battleUiIconsUrl, {
frameWidth: battleUiIconFrameSize,
frameHeight: battleUiIconFrameSize
});
scene.load.start();
}