Render equipment icons at higher resolution
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
import Phaser from 'phaser';
|
import Phaser from 'phaser';
|
||||||
import titleBackgroundUrl from '../../assets/images/taoyuan-oath-title.png';
|
import titleBackgroundUrl from '../../assets/images/taoyuan-oath-title.png';
|
||||||
|
|
||||||
|
const itemIconSourceSize = 28;
|
||||||
|
const itemIconTextureSize = 64;
|
||||||
|
|
||||||
export class BootScene extends Phaser.Scene {
|
export class BootScene extends Phaser.Scene {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('BootScene');
|
super('BootScene');
|
||||||
@@ -64,10 +67,11 @@ export class BootScene extends Phaser.Scene {
|
|||||||
|
|
||||||
const graphics = this.make.graphics({ x: 0, y: 0 });
|
const graphics = this.make.graphics({ x: 0, y: 0 });
|
||||||
graphics.fillStyle(0x101820, 0);
|
graphics.fillStyle(0x101820, 0);
|
||||||
graphics.fillRect(0, 0, 28, 28);
|
graphics.fillRect(0, 0, itemIconTextureSize, itemIconTextureSize);
|
||||||
|
graphics.scaleCanvas(itemIconTextureSize / itemIconSourceSize, itemIconTextureSize / itemIconSourceSize);
|
||||||
graphics.lineStyle(1, 0x05070a, 0.7);
|
graphics.lineStyle(1, 0x05070a, 0.7);
|
||||||
draw(graphics);
|
draw(graphics);
|
||||||
graphics.generateTexture(key, 28, 28);
|
graphics.generateTexture(key, itemIconTextureSize, itemIconTextureSize);
|
||||||
graphics.destroy();
|
graphics.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user