This commit is contained in:
Torsten 2025-05-31 11:18:33 +02:00
parent 2f4be2d317
commit 3a4b1cea9b

View file

@ -0,0 +1,21 @@
```python
extends Node2D
@onready var main: Node2D = $"."
@onready var palette: VBoxContainer = $UI/PanelContainer/ScrollContainer/VBoxContainer
func _ready():
print("Palette initialized.")
var atlas_texture = AtlasTexture.new()
var atlas_image = Image.new()
atlas_image.load("res://assets/spritesheets/map_hex_terrain_72x72_spritesheet.png")
atlas_texture.atlas = ImageTexture.create_from_image(atlas_image)
atlas_texture.region = Rect2(Vector2(0,73),Vector2(72,72)) # x,y,width,height
var tr = TextureRect.new()
tr.texture = atlas_texture
palette.add_child(tr)
```