From fa92fda3e7ea53d479402dcdbd153177ef030c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 15 Jul 2020 11:24:56 +0200 Subject: timeout before resized on ready (fix android), OSInfo --- Main.gd | 2 ++ Main.tscn | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/Main.gd b/Main.gd index 5e82637..432baba 100644 --- a/Main.gd +++ b/Main.gd @@ -17,7 +17,9 @@ func _ready(): Map.connect("hex_touched", self, "on_hex_touched") $CanvasLayer/HBOX/ViewportContainer.connect("resized", self, "on_viewport_resized") on_toggle() + yield(get_tree().create_timer(.2), 'timeout') on_viewport_resized() + UI.get_node("OSInfo").text = "screen\n%s\ndpi %d" % [OS.get_screen_size(), OS.get_screen_dpi()] func on_viewport_resized() -> void: Camera.configure($CanvasLayer/HBOX/ViewportContainer/Viewport.size, Map.center(), Map.texture_size()) diff --git a/Main.tscn b/Main.tscn index eecc8ba..ab3f410 100644 --- a/Main.tscn +++ b/Main.tscn @@ -136,3 +136,11 @@ margin_bottom = 574.0 __meta__ = { "_edit_use_anchors_": false } + +[node name="OSInfo" type="Label" parent="CanvasLayer/HBOX/UI"] +margin_top = 604.0 +margin_right = 250.0 +margin_bottom = 640.0 +__meta__ = { +"_edit_use_anchors_": false +} -- cgit v1.1-2-g2b99