From 45fd683168d201b17851a1cf9258c0d0b3c05bf5 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Thu, 4 Jun 2020 16:29:32 +0200 Subject: [PATCH] resize taquin to 2/3rd of the window --- src/Main.gd | 2 ++ src/Main.tscn | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Main.gd b/src/Main.gd index fb2407f..03bbbe6 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -4,6 +4,7 @@ onready var container = $GridContainer onready var taquin = $GridContainer/Taquin func _ready(): + taquin.rect_min_size = get_viewport().get_visible_rect().size * (2.0 / 3.0) layout_reflow() load_game() print("Starting state: ", taquin.current_state_name()) @@ -27,6 +28,7 @@ func layout_reflow(): else: # landscape container.columns = 2 + update() # https://docs.godotengine.org/en/3.2/tutorials/io/saving_games.html func save_game(): diff --git a/src/Main.tscn b/src/Main.tscn index d034c41..00aa15d 100644 --- a/src/Main.tscn +++ b/src/Main.tscn @@ -32,6 +32,8 @@ margin_right = -20.0 margin_bottom = -20.0 size_flags_horizontal = 3 size_flags_vertical = 3 +custom_constants/vseparation = 10 +custom_constants/hseparation = 10 columns = 2 __meta__ = { "_edit_use_anchors_": false @@ -46,7 +48,7 @@ margin_right = 540.0 margin_bottom = 560.0 [node name="VBoxContainer" type="VBoxContainer" parent="GridContainer"] -margin_left = 548.0 +margin_left = 550.0 margin_right = 984.0 margin_bottom = 560.0 size_flags_horizontal = 3 @@ -57,7 +59,7 @@ alignment = 1 anchor_right = 0.0 anchor_bottom = 0.0 margin_top = 206.0 -margin_right = 436.0 +margin_right = 434.0 margin_bottom = 276.0 rect_min_size = Vector2( 0, 70 ) text = "New Game" @@ -66,7 +68,7 @@ text = "New Game" anchor_right = 0.0 anchor_bottom = 0.0 margin_top = 284.0 -margin_right = 436.0 +margin_right = 434.0 margin_bottom = 354.0 rect_min_size = Vector2( 0, 70 ) text = "Hints"