minor changes to UI

This commit is contained in:
Jaap Marsman 2022-11-11 21:20:08 +08:00
parent d1a619735a
commit 92295de666
4 changed files with 78 additions and 31 deletions

View File

@ -1,10 +1,18 @@
extends Node extends Node
onready var player_vars = get_node("/root/PlayerVariables")
# Called when the node enters the scene tree for the first time. onready var player_vars = get_node("/root/PlayerVariables")
#func _ready(): onready var game_time = get_node("/root/GameTimer")
# pass
func _ready():
# Keep everything hidden but bring up the starting menu
game_time.paused = 1
$"%UI".visible = false
$"%Landscape".visible = false
$"%StartScreen".visible = true
#func _process(delta): #func _process(delta):
# pass # pass

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=32 format=2] [gd_scene load_steps=33 format=2]
[ext_resource path="res://MainCamera.gd" type="Script" id=1] [ext_resource path="res://MainCamera.gd" type="Script" id=1]
[ext_resource path="res://Pupils.gd" type="Script" id=2] [ext_resource path="res://Pupils.gd" type="Script" id=2]
@ -18,6 +18,7 @@
[ext_resource path="res://Dialogs/Josephine1.gd" type="Script" id=16] [ext_resource path="res://Dialogs/Josephine1.gd" type="Script" id=16]
[ext_resource path="res://Dialogs.gd" type="Script" id=17] [ext_resource path="res://Dialogs.gd" type="Script" id=17]
[ext_resource path="res://Assets/Jellee-Bold.ttf" type="DynamicFontData" id=18] [ext_resource path="res://Assets/Jellee-Bold.ttf" type="DynamicFontData" id=18]
[ext_resource path="res://StartScreen.gd" type="Script" id=19]
[sub_resource type="DynamicFont" id=1] [sub_resource type="DynamicFont" id=1]
size = 32 size = 32
@ -76,7 +77,7 @@ bg_color = Color( 0.364706, 0.364706, 0.364706, 1 )
[node name="Main" type="Node"] [node name="Main" type="Node"]
script = ExtResource( 5 ) script = ExtResource( 5 )
[node name="ColorRect" type="ColorRect" parent="."] [node name="BlueBackground" type="ColorRect" parent="."]
margin_left = -6301.29 margin_left = -6301.29
margin_top = -4096.0 margin_top = -4096.0
margin_right = 6909.71 margin_right = 6909.71
@ -89,6 +90,8 @@ __meta__ = {
} }
[node name="Landscape" type="Node2D" parent="."] [node name="Landscape" type="Node2D" parent="."]
unique_name_in_owner = true
visible = false
position = Vector2( -500, -1200 ) position = Vector2( -500, -1200 )
[node name="GrassFloor" type="TileMap" parent="Landscape"] [node name="GrassFloor" type="TileMap" parent="Landscape"]
@ -324,13 +327,30 @@ texture = ExtResource( 3 )
offset = Vector2( 4, 4 ) offset = Vector2( 4, 4 )
[node name="MainCamera" type="Camera2D" parent="."] [node name="MainCamera" type="Camera2D" parent="."]
unique_name_in_owner = true
position = Vector2( 901.653, 1291.88 ) position = Vector2( 901.653, 1291.88 )
offset = Vector2( -100, -900 ) offset = Vector2( -100, -900 )
current = true current = true
zoom = Vector2( 1.5, 1.5 ) zoom = Vector2( 1.5, 1.5 )
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="StartScreen" type="CanvasLayer" parent="."]
unique_name_in_owner = true
script = ExtResource( 19 )
[node name="StartGame" type="Button" parent="StartScreen"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -41.0
margin_top = -22.0
margin_right = 41.0
margin_bottom = 22.0
text = "Start"
[node name="UI" type="CanvasLayer" parent="."] [node name="UI" type="CanvasLayer" parent="."]
unique_name_in_owner = true
script = ExtResource( 10 ) script = ExtResource( 10 )
[node name="Dialogs" type="Node" parent="UI"] [node name="Dialogs" type="Node" parent="UI"]
@ -383,9 +403,6 @@ margin_top = 12.2021
margin_right = 38.2957 margin_right = 38.2957
margin_bottom = 32.2021 margin_bottom = 32.2021
text = "||" text = "||"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="RatingTitle" type="Label" parent="UI/MainMenu"] [node name="RatingTitle" type="Label" parent="UI/MainMenu"]
anchor_top = 1.0 anchor_top = 1.0
@ -606,65 +623,71 @@ __meta__ = {
} }
[node name="Bars" type="Control" parent="UI/MainMenu"] [node name="Bars" type="Control" parent="UI/MainMenu"]
margin_right = 40.0 margin_left = 1724.0
margin_bottom = 40.0 margin_top = 854.0
__meta__ = { margin_right = 1896.0
"_edit_use_anchors_": false margin_bottom = 1068.0
}
[node name="PupilBar" type="ProgressBar" parent="UI/MainMenu/Bars"] [node name="PupilBar" type="ProgressBar" parent="UI/MainMenu/Bars"]
margin_left = 1784.6 margin_left = 95.4001
margin_top = 1061.48 margin_top = 164.25
margin_right = 1908.6 margin_right = 219.4
margin_bottom = 1080.48 margin_bottom = 183.25
rect_rotation = 270.0 rect_rotation = 270.0
custom_styles/fg = SubResource( 7 ) custom_styles/fg = SubResource( 7 )
percent_visible = false percent_visible = false
__meta__ = { __meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="TeacherBar" type="ProgressBar" parent="UI/MainMenu/Bars"] [node name="TeacherBar" type="ProgressBar" parent="UI/MainMenu/Bars"]
margin_left = 1821.78 margin_left = 132.58
margin_top = 1061.23 margin_top = 164.0
margin_right = 1945.78 margin_right = 256.58
margin_bottom = 1080.23 margin_bottom = 183.0
rect_rotation = 270.0 rect_rotation = 270.0
custom_styles/fg = SubResource( 7 ) custom_styles/fg = SubResource( 7 )
percent_visible = false percent_visible = false
__meta__ = { __meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="PBar" type="Label" parent="UI/MainMenu/Bars"] [node name="PBar" type="Label" parent="UI/MainMenu/Bars"]
anchor_top = 1.0 anchor_top = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_left = 1783.85 margin_left = 94.6501
margin_top = 849.524 margin_top = -47.7061
margin_right = 1807.85 margin_right = 118.65
margin_bottom = 888.524 margin_bottom = -8.70605
custom_fonts/font = SubResource( 1 ) custom_fonts/font = SubResource( 1 )
text = "P" text = "P"
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_lock_": true
} }
[node name="TBar" type="Label" parent="UI/MainMenu/Bars"] [node name="TBar" type="Label" parent="UI/MainMenu/Bars"]
anchor_top = 1.0 anchor_top = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_left = 1821.95 margin_left = 132.75
margin_top = 849.524 margin_top = -47.7061
margin_right = 1845.95 margin_right = 156.75
margin_bottom = 888.524 margin_bottom = -8.70605
custom_fonts/font = SubResource( 1 ) custom_fonts/font = SubResource( 1 )
text = "T" text = "T"
__meta__ = { __meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="Line2D" type="Line2D" parent="UI/MainMenu/Bars"] [node name="Line2D" type="Line2D" parent="UI/MainMenu/Bars"]
position = Vector2( -1689.2, -897.23 )
points = PoolVector2Array( 1773.2, 998.934, 1851.95, 998.934 ) points = PoolVector2Array( 1773.2, 998.934, 1851.95, 998.934 )
width = 4.0 width = 4.0
__meta__ = {
"_edit_lock_": true
}
[node name="PausedRect" type="ColorRect" parent="UI"] [node name="PausedRect" type="ColorRect" parent="UI"]
visible = false visible = false
@ -1768,6 +1791,7 @@ script = ExtResource( 6 )
[node name="ClassTeachers" type="Node" parent="."] [node name="ClassTeachers" type="Node" parent="."]
script = ExtResource( 7 ) script = ExtResource( 7 )
[connection signal="pressed" from="StartScreen/StartGame" to="StartScreen" method="_on_StartGame_pressed"]
[connection signal="pressed" from="UI/MainMenu/SpeedOne" to="UI" method="_on_SpeedOne_pressed"] [connection signal="pressed" from="UI/MainMenu/SpeedOne" to="UI" method="_on_SpeedOne_pressed"]
[connection signal="pressed" from="UI/MainMenu/SpeedThree" to="UI" method="_on_SpeedThree_pressed"] [connection signal="pressed" from="UI/MainMenu/SpeedThree" to="UI" method="_on_SpeedThree_pressed"]
[connection signal="pressed" from="UI/MainMenu/SpeedTwo" to="UI" method="_on_SpeedTwo_pressed"] [connection signal="pressed" from="UI/MainMenu/SpeedTwo" to="UI" method="_on_SpeedTwo_pressed"]

14
godot/StartScreen.gd Normal file
View File

@ -0,0 +1,14 @@
extends CanvasLayer
onready var game_time = get_node("/root/GameTimer")
func _ready():
pass
func _on_StartGame_pressed():
game_time.paused = 0
$"%StartScreen".visible = false
$"%UI".visible = true
$"%Landscape".visible = true

1
schoolgame.wiki Submodule

@ -0,0 +1 @@
Subproject commit ef635a79e93b4a645b6fe2e193bdc959c937e1c1