Improve tactical unit pixel sprites

This commit is contained in:
2026-06-22 02:35:53 +09:00
parent b0c6c0ebea
commit 971132c7a4
2 changed files with 290 additions and 124 deletions

View File

@@ -24,7 +24,7 @@ const unitTexture: Record<string, string> = {
'zhang-fei': 'unit-zhang-fei',
'rebel-a': 'unit-rebel',
'rebel-b': 'unit-rebel',
'rebel-c': 'unit-rebel-cavalry',
'rebel-c': 'unit-rebel-archer',
'rebel-leader': 'unit-rebel-leader'
};
@@ -244,7 +244,7 @@ export class BattleScene extends Phaser.Scene {
private drawUnits() {
firstBattleUnits.forEach((unit) => {
const sizeRatio = unit.faction === 'ally' ? 0.98 : 0.92;
const sizeRatio = unit.faction === 'ally' ? 1.08 : 1.02;
const sprite = this.add.image(this.tileCenterX(unit.x), this.tileCenterY(unit.y), unitTexture[unit.id] ?? 'unit-rebel');
sprite.setName(`unit-${unit.id}`);
sprite.setDisplaySize(this.layout.tileSize * sizeRatio, this.layout.tileSize * sizeRatio);
@@ -252,12 +252,12 @@ export class BattleScene extends Phaser.Scene {
sprite.setInteractive({ useHandCursor: unit.faction === 'ally' });
sprite.on('pointerdown', () => this.selectUnit(unit));
const label = this.add.text(sprite.x, sprite.y + this.layout.tileSize * 0.36, unit.name, {
const label = this.add.text(sprite.x, sprite.y + this.layout.tileSize * 0.47, unit.name, {
fontFamily: '"Malgun Gothic", "Noto Sans KR", sans-serif',
fontSize: '13px',
fontSize: '11px',
color: unit.faction === 'ally' ? '#e7edf7' : '#ffebe7',
backgroundColor: 'rgba(8,10,14,0.78)',
padding: { left: 5, right: 5, top: 2, bottom: 2 }
stroke: '#05070a',
strokeThickness: 3
});
label.setOrigin(0.5, 0);
label.setDepth(7);
@@ -771,7 +771,7 @@ export class BattleScene extends Phaser.Scene {
view.sprite.setAlpha(1);
view.label.setAlpha(1);
view.label.setColor(unit?.faction === 'ally' ? '#e7edf7' : '#ffebe7');
view.label.setBackgroundColor('rgba(8,10,14,0.78)');
view.label.setBackgroundColor('');
});
}
@@ -967,7 +967,7 @@ export class BattleScene extends Phaser.Scene {
view.sprite.setTint(0xb7b7b7);
view.label.setAlpha(0.55);
view.label.setColor('#b9b9b9');
view.label.setBackgroundColor('rgba(20,20,20,0.66)');
view.label.setBackgroundColor('');
}
private renderBondPanel(message?: string) {