diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2020-07-15 09:39:59 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2020-07-15 09:39:59 +0200 |
commit | 069071ad40850f2880367885a3100676f716030d (patch) | |
tree | 309e8d5a1e08187002ac71fd97c603269952f5cc /Main.gd | |
parent | f5fad353fa1afbbab81438ac73242821b06e5b61 (diff) | |
download | godot-hexgrid-069071ad40850f2880367885a3100676f716030d.zip godot-hexgrid-069071ad40850f2880367885a3100676f716030d.tar.gz |
redo app tree to support resizing
Diffstat (limited to 'Main.gd')
-rw-r--r-- | Main.gd | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -3,21 +3,21 @@ extends Node2D var drag_map : bool = false -onready var UI : CanvasLayer = $UI -onready var Map : Sprite = $ViewportContainer/Viewport/Map -onready var Camera : Camera2D = $ViewportContainer/Viewport/Camera +onready var UI : Control = $CanvasLayer/HBOX/UI +onready var Map : Sprite = $CanvasLayer/HBOX/ViewportContainer/Viewport/Map +onready var Camera : Camera2D = $CanvasLayer/HBOX/ViewportContainer/Viewport/Camera func _ready(): UI.get_node("rotate").connect("pressed", self, "on_rotate") UI.get_node("LOS").connect("pressed", self, "on_toggle") UI.get_node("Move").connect("pressed", self, "on_toggle") Map.connect("hex_touched", self, "on_hex_touched") - $ViewportContainer.connect("resized", self, "on_viewport_resized") + $CanvasLayer/HBOX/ViewportContainer.connect("resized", self, "on_viewport_resized") on_toggle() on_viewport_resized() func on_viewport_resized() -> void: - Camera.configure($ViewportContainer/Viewport.size, Map.center(), Map.texture_size()) + Camera.configure($CanvasLayer/HBOX/ViewportContainer/Viewport.size, Map.center(), Map.texture_size()) func on_rotate() -> void: Map.rotate_map() |