Files
gplan-2/game/data/schemas/camp_scene_layer_spec.gd
T

14 lines
763 B
GDScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 营地场景单层规格(camp_scene_layout.tres 行件):层键+贴图矩形+命中矩形+命中键。
## z 序=表内数组序(视图子节点序同源派生);坐标一律终稿画布 1280×800 像素坐标。
class_name CampSceneLayerSpec
extends Resource
@export var key: StringName = &"" # 层键(对齐 UiKit.TEX_CAMP_* 常量后缀)
@export var texture_rect: Rect2 = Rect2() # 贴图矩形(1:1 像素贴图落位)
@export var hotspot: Rect2 = Rect2() # 命中矩形(零矩形=不可点层——bg/wall/tent)
@export var hotspot_key: StringName = &"" # object_pressed 载荷键(可点层必填)
func is_clickable() -> bool:
return hotspot.size.x > 0.0 and hotspot.size.y > 0.0