različne velikosti dreves

This commit is contained in:
2025-12-07 03:40:50 +01:00
parent 9eb57ed117
commit 521468c797
8 changed files with 323 additions and 109 deletions

View File

@@ -765,4 +765,70 @@ class TextureGenerator {
canvas.refresh();
return canvas;
}
// ========== ITEM ICONS ==========
static createToolSprites(scene) {
// AXE ICON
if (!scene.textures.exists('item_axe')) {
const size = 32;
const canvas = scene.textures.createCanvas('item_axe', size, size);
const ctx = canvas.getContext();
ctx.clearRect(0, 0, size, size);
// Handle
ctx.fillStyle = '#8B4513';
ctx.fillRect(14, 10, 4, 18);
// Blade (Double bit axe style)
ctx.fillStyle = '#C0C0C0'; // Silver
ctx.beginPath();
ctx.moveTo(16, 12);
ctx.lineTo(6, 6); // Left Top
ctx.lineTo(6, 18); // Left Bottom
ctx.lineTo(16, 14); // Center Bottom
ctx.lineTo(26, 18); // Right Bottom
ctx.lineTo(26, 6); // Right Top
ctx.closePath();
ctx.fill();
// Edge
ctx.strokeStyle = '#FFFFFF';
ctx.lineWidth = 1;
ctx.stroke();
canvas.refresh();
}
// PICKAXE ICON
if (!scene.textures.exists('item_pickaxe')) {
const size = 32;
const canvas = scene.textures.createCanvas('item_pickaxe', size, size);
const ctx = canvas.getContext();
ctx.clearRect(0, 0, size, size);
// Handle
ctx.fillStyle = '#8B4513';
ctx.fillRect(14, 10, 4, 18);
// Head (Curved)
ctx.fillStyle = '#808080'; // Dark Grey
ctx.beginPath();
ctx.moveTo(2, 12); // Left Tip
ctx.quadraticCurveTo(16, 4, 30, 12); // Curve to Right Tip
ctx.lineTo(28, 16); // Right Inner
ctx.quadraticCurveTo(16, 8, 4, 16); // Curve to Left Inner
ctx.closePath();
ctx.fill();
// Outline
ctx.strokeStyle = '#000000';
ctx.lineWidth = 1;
ctx.stroke();
canvas.refresh();
}
}
}