Basic layout implemented

This commit is contained in:
Terry Hearst 2022-02-20 14:35:55 -05:00
parent ed89f216da
commit 11bd8f5f3f
12 changed files with 137 additions and 0 deletions

7
fonts/DefaultFont.tres Normal file
View file

@ -0,0 +1,7 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="DynamicFontData" id=1]
[resource]
size = 36
font_data = ExtResource( 1 )

5
fonts/License.txt Normal file
View file

@ -0,0 +1,5 @@
This is a Sans serif basic font. It's a professional version which was complicated hand-made
and computer-generated graphics, and various revisions. After installing on the computer,
you can create posters, web graphics, game graphics, t-shirts, videos, signs, logos and more.
These fonts are 100% FREE for both personal and business usages. If you have any question,
please feel free to contact me. yiningchen23@gmail.com

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
fonts/Louis George Cafe.ttf Normal file

Binary file not shown.

View file

@ -11,12 +11,26 @@ config_version=4
[application] [application]
config/name="godot-wordle" config/name="godot-wordle"
run/main_scene="res://src/Main.tscn"
config/icon="res://icon.png" config/icon="res://icon.png"
[display]
window/size/width=640
window/size/height=960
window/handheld/orientation="portrait"
window/stretch/mode="2d"
window/stretch/aspect="keep"
[gui]
theme/custom_font="res://fonts/DefaultFont.tres"
[physics] [physics]
common/enable_pause_aware_picking=true common/enable_pause_aware_picking=true
[rendering] [rendering]
environment/default_clear_color=Color( 0.129412, 0.129412, 0.215686, 1 )
environment/default_environment="res://default_env.tres" environment/default_environment="res://default_env.tres"

26
src/Letter.tscn Normal file
View file

@ -0,0 +1,26 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="DynamicFontData" id=1]
[sub_resource type="DynamicFont" id=1]
size = 52
font_data = ExtResource( 1 )
[node name="Letter" type="ColorRect"]
margin_right = 85.0
margin_bottom = 85.0
rect_min_size = Vector2( 85, 85 )
color = Color( 0.0313726, 0.0313726, 0.0588235, 0.509804 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
custom_fonts/font = SubResource( 1 )
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}

23
src/Main.gd Normal file
View file

@ -0,0 +1,23 @@
extends CenterContainer
const letter_count := 5
const guess_count := 6
const Letter = preload("res://src/Letter.tscn")
export var color_incorrect: Color = Color()
export var color_misplaced: Color = Color()
export var color_correct: Color = Color()
# An array of arrays of the letter nodes
var letters := []
func _ready() -> void:
for _i in range(guess_count):
var letter_array := []
for _j in range(letter_count):
var letter := Letter.instance()
letter_array.append(letter)
$V/LetterGrid.add_child(letter)
letters.append(letter_array)

62
src/Main.tscn Normal file
View file

@ -0,0 +1,62 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="DynamicFontData" id=1]
[ext_resource path="res://src/Main.gd" type="Script" id=2]
[sub_resource type="DynamicFont" id=1]
size = 72
font_data = ExtResource( 1 )
[node name="Main" type="CenterContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
color_incorrect = Color( 0.258824, 0.258824, 0.301961, 1 )
color_misplaced = Color( 0.698039, 0.74902, 0, 1 )
color_correct = Color( 0, 0.619608, 0.298039, 1 )
[node name="V" type="VBoxContainer" parent="."]
margin_left = 90.0
margin_top = 393.0
margin_right = 550.0
margin_bottom = 566.0
custom_constants/separation = 20
[node name="Title" type="Label" parent="V"]
margin_right = 460.0
margin_bottom = 82.0
custom_fonts/font = SubResource( 1 )
text = "Godot Wordle"
align = 1
[node name="LetterGrid" type="GridContainer" parent="V"]
margin_left = 230.0
margin_top = 102.0
margin_right = 230.0
margin_bottom = 102.0
grow_horizontal = 2
size_flags_horizontal = 4
custom_constants/vseparation = 8
custom_constants/hseparation = 8
columns = 5
[node name="H" type="HBoxContainer" parent="V"]
margin_top = 122.0
margin_right = 460.0
margin_bottom = 173.0
custom_constants/separation = 12
[node name="GuessText" type="LineEdit" parent="V/H"]
margin_right = 334.0
margin_bottom = 51.0
size_flags_horizontal = 3
max_length = 5
[node name="GuessButton" type="Button" parent="V/H"]
margin_left = 346.0
margin_right = 460.0
margin_bottom = 51.0
text = "Guess"