online multiplayer chess game (note server currently down)
| -rw-r--r-- | project.godot | 2 | ||||
| -rw-r--r-- | ui/GameUI.tscn | 29 | ||||
| -rw-r--r-- | ui/sandisplay/SanDisplay.gd | 11 | ||||
| -rw-r--r-- | ui/sandisplay/SanDisplay.tscn | 1 |
4 files changed, 25 insertions, 18 deletions
diff --git a/project.godot b/project.godot index 7e12dac..3b8a2c8 100644 --- a/project.godot +++ b/project.godot @@ -153,7 +153,7 @@ gdscript/warnings/return_value_discarded=false [display] -window/size/width=1200 +window/size/width=1422 window/size/height=800 window/stretch/mode="2d" window/stretch/aspect="keep" diff --git a/ui/GameUI.tscn b/ui/GameUI.tscn index c85aeb5..72d58df 100644 --- a/ui/GameUI.tscn +++ b/ui/GameUI.tscn @@ -35,10 +35,10 @@ font_data = ExtResource( 3 ) anchor_left = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 -margin_left = -400.0 +margin_left = -624.0 theme = ExtResource( 1 ) __meta__ = { -"_edit_lock_": true +"_edit_group_": true } [node name="Back" type="ColorRect" parent="Holder"] @@ -59,7 +59,7 @@ __meta__ = { [node name="BlackTime" type="Label" parent="Holder/Back/VBox"] margin_top = 107.0 -margin_right = 400.0 +margin_right = 624.0 margin_bottom = 190.0 custom_fonts/font = ExtResource( 2 ) text = "00:00.0" @@ -92,11 +92,12 @@ script = ExtResource( 7 ) [node name="MovesList" parent="Holder/Back/VBox" instance=ExtResource( 6 )] margin_top = 205.0 +margin_right = 624.0 margin_bottom = 405.0 [node name="buttonbarholder" type="Control" parent="Holder/Back/VBox"] margin_top = 420.0 -margin_right = 400.0 +margin_right = 624.0 margin_bottom = 470.0 rect_min_size = Vector2( 50, 50 ) @@ -106,14 +107,14 @@ anchor_bottom = 1.0 custom_styles/panel = SubResource( 10 ) [node name="buttonbar" type="HBoxContainer" parent="Holder/Back/VBox/buttonbarholder"] -margin_right = 400.0 -margin_bottom = 50.0 +anchor_right = 1.0 +anchor_bottom = 1.0 custom_constants/separation = 0 alignment = 1 [node name="FlipBoard" parent="Holder/Back/VBox/buttonbarholder/buttonbar" instance=ExtResource( 16 )] -margin_left = 175.0 -margin_right = 225.0 +margin_left = 287.0 +margin_right = 337.0 margin_bottom = 50.0 script = ExtResource( 18 ) texture = ExtResource( 17 ) @@ -128,7 +129,7 @@ texture = ExtResource( 9 ) [node name="WhiteTime" type="Label" parent="Holder/Back/VBox"] margin_top = 485.0 -margin_right = 400.0 +margin_right = 624.0 margin_bottom = 568.0 custom_fonts/font = ExtResource( 2 ) text = "00:00.0" @@ -154,24 +155,28 @@ script = ExtResource( 5 ) [node name="Spacer" type="Control" parent="Holder/Back/VBox"] margin_top = 583.0 -margin_right = 400.0 +margin_right = 624.0 margin_bottom = 603.0 rect_min_size = Vector2( 0, 20 ) [node name="FENlabel" type="LineEdit" parent="Holder/Back/VBox"] +margin_left = 58.0 margin_top = 618.0 -margin_right = 400.0 +margin_right = 566.0 margin_bottom = 692.0 +size_flags_horizontal = 4 custom_colors/font_color_uneditable = Color( 1, 1, 1, 1 ) custom_fonts/font = SubResource( 8 ) text = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" +align = 1 editable = false +expand_to_text_length = true placeholder_text = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" script = ExtResource( 15 ) [node name="Label" type="Label" parent="Holder/Back/VBox/FENlabel"] margin_top = -49.0 -margin_right = 400.0 +margin_right = 508.0 margin_bottom = 11.0 custom_fonts/font = SubResource( 9 ) text = "fen" diff --git a/ui/sandisplay/SanDisplay.gd b/ui/sandisplay/SanDisplay.gd index d07be03..33713d4 100644 --- a/ui/sandisplay/SanDisplay.gd +++ b/ui/sandisplay/SanDisplay.gd @@ -13,17 +13,18 @@ func _ready() -> void: tween = Tween.new() add_child(tween) Utils.connect("newmove", self, "on_new_move") - + create_number_label(1) + create_san_label("Qxb4", Label.ALIGN_LEFT) + create_san_label("e4") func create_number_label(num) -> void: var clr = ColorRect.new() clr.color = Color(1, 1, 1, 0.13) clr.rect_min_size = Vector2(70, 30) var label = Label.new() - label.text = str(num) + ". " - label.align = Label.ALIGN_RIGHT + label.text = " %s." % str(num) + label.align = Label.ALIGN_LEFT label.valign = Label.VALIGN_CENTER - label.rect_min_size = clr.rect_min_size clr.add_child(label) sans.add_child(clr) @@ -33,7 +34,7 @@ func create_san_label(text, alignment = Label.ALIGN_RIGHT) -> void: label.text = text label.valign = Label.VALIGN_CENTER label.align = alignment - label.rect_min_size = Vector2(115, 0) + label.rect_min_size = Vector2((rect_size.x / 2.4), 0) sans.add_child(label) diff --git a/ui/sandisplay/SanDisplay.tscn b/ui/sandisplay/SanDisplay.tscn index 38fbc97..39ce666 100644 --- a/ui/sandisplay/SanDisplay.tscn +++ b/ui/sandisplay/SanDisplay.tscn @@ -84,4 +84,5 @@ script = ExtResource( 8 ) [node name="sans" type="GridContainer" parent="."] custom_constants/vseparation = 0 +custom_constants/hseparation = 10 columns = 3 |