popravki
This commit is contained in:
@@ -20,6 +20,7 @@ class GameScene extends Phaser.Scene {
|
||||
|
||||
// Generate procedural textures
|
||||
new TextureGenerator(this).generateAll();
|
||||
InventoryIcons.create(this); // Override with flat 2D inventory icons
|
||||
window.gameState.currentScene = 'GameScene';
|
||||
|
||||
const width = this.cameras.main.width;
|
||||
|
||||
@@ -362,25 +362,28 @@ class UIScene extends Phaser.Scene {
|
||||
// Draw Sprite
|
||||
const sprite = this.add.sprite(x + size / 2, y + size / 2, textureKey);
|
||||
|
||||
// Scale to fit slot (32px slot, maybe 24px icon)
|
||||
const scale = (size - 8) / Math.max(sprite.width, sprite.height);
|
||||
sprite.setScale(scale);
|
||||
// Larger scale for better visibility (fill most of the slot)
|
||||
const scale = (size - 4) / Math.max(sprite.width, sprite.height);
|
||||
sprite.setScale(scale * 1.2); // 20% bigger!
|
||||
|
||||
// Crisp 2D rendering
|
||||
sprite.setTexture(textureKey);
|
||||
|
||||
slotGraphics.itemSprite = sprite;
|
||||
} else {
|
||||
// Fallback Text
|
||||
// Fallback Text - bigger and bolder
|
||||
const text = this.add.text(x + size / 2, y + size / 2,
|
||||
type.substring(0, 2).toUpperCase(),
|
||||
{ fontSize: '12px', align: 'center', color: '#ffff00', stroke: '#000', strokeThickness: 2 }
|
||||
type.substring(0, 3).toUpperCase(),
|
||||
{ fontSize: '16px', align: 'center', color: '#ffff00', stroke: '#000', strokeThickness: 3, fontStyle: 'bold' }
|
||||
).setOrigin(0.5);
|
||||
slotGraphics.itemText = text;
|
||||
}
|
||||
|
||||
// Draw Count (if > 1)
|
||||
// Draw Count (if > 1) - bigger and bolder
|
||||
if (slots[i].count > 1) {
|
||||
const countText = this.add.text(x + size - 2, y + size - 2,
|
||||
slots[i].count.toString(),
|
||||
{ fontSize: '10px', align: 'right', color: '#ffffff', stroke: '#000', strokeThickness: 2 }
|
||||
{ fontSize: '14px', align: 'right', color: '#ffffff', stroke: '#000', strokeThickness: 3, fontStyle: 'bold' }
|
||||
).setOrigin(1, 1);
|
||||
slotGraphics.countText = countText;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user