21 lines
503 B
GDScript3
21 lines
503 B
GDScript3
|
extends Window
|
||
|
|
||
|
var key
|
||
|
|
||
|
@onready var data = Data.data.zones[key]
|
||
|
@onready var image = Data.data.images[key]
|
||
|
|
||
|
@onready var sprite_2d: Sprite2D = $Sprite2D
|
||
|
|
||
|
const CREATURE = preload("res://src/Creature.tscn")
|
||
|
|
||
|
func _ready() -> void:
|
||
|
title = data.name
|
||
|
sprite_2d.texture = image
|
||
|
sprite_2d.position = Vector2(int(data.size[0]) * 12 / 2, int(data.size[1]) * 12 / 2)
|
||
|
|
||
|
var new_creature = CREATURE.instantiate()
|
||
|
new_creature.position = Vector2(50, 50)
|
||
|
new_creature.key = "1x1-1"
|
||
|
add_child(new_creature)
|