summaryrefslogtreecommitdiffstats
path: root/Main.gd
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-07-15 09:39:59 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-07-15 09:39:59 +0200
commit069071ad40850f2880367885a3100676f716030d (patch)
tree309e8d5a1e08187002ac71fd97c603269952f5cc /Main.gd
parentf5fad353fa1afbbab81438ac73242821b06e5b61 (diff)
downloadgodot-hexgrid-069071ad40850f2880367885a3100676f716030d.zip
godot-hexgrid-069071ad40850f2880367885a3100676f716030d.tar.gz
redo app tree to support resizing
Diffstat (limited to 'Main.gd')
-rw-r--r--Main.gd10
1 files changed, 5 insertions, 5 deletions
diff --git a/Main.gd b/Main.gd
index 6c8b942..03c9773 100644
--- a/Main.gd
+++ b/Main.gd
@@ -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()