diff --git a/GodotUI/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 b/GodotUI/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 new file mode 100644 index 0000000..7b61c3e --- /dev/null +++ b/GodotUI/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 @@ -0,0 +1,3 @@ +source_md5="47313fa4c47a9963fddd764e1ec6e4a8" +dest_md5="2ded9e7f9060e2b530aab678b135fc5b" + diff --git a/GodotUI/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex b/GodotUI/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex new file mode 100644 index 0000000..3ca6461 Binary files /dev/null and b/GodotUI/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex differ diff --git a/GodotUI/GUI.tscn b/GodotUI/GUI.tscn new file mode 100644 index 0000000..df0cf85 --- /dev/null +++ b/GodotUI/GUI.tscn @@ -0,0 +1,76 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Player_Settings_Button.gd" type="Script" id=1] +[ext_resource path="res://HostAndJoinGame.gd" type="Script" id=2] +[ext_resource path="res://Start Game.gd" type="Script" id=3] + +[node name="GUI" type="MarginContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_top = -0.418091 +margin_bottom = -0.418091 +custom_constants/margin_right = 120 +custom_constants/margin_top = 80 +custom_constants/margin_left = 120 +custom_constants/margin_bottom = 80 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +margin_left = 120.0 +margin_top = 80.0 +margin_right = 904.0 +margin_bottom = 520.0 + +[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"] +margin_right = 112.0 +margin_bottom = 440.0 + +[node name="MenuOptions" type="VBoxContainer" parent="HBoxContainer/VBoxContainer"] +margin_right = 112.0 +margin_bottom = 440.0 +size_flags_vertical = 3 +custom_constants/separation = 30 +alignment = 1 + +[node name="Start Game" type="Label" parent="HBoxContainer/VBoxContainer/MenuOptions"] +margin_top = 169.0 +margin_right = 112.0 +margin_bottom = 183.0 +mouse_filter = 1 +text = "Start Game" +script = ExtResource( 3 ) + +[node name="HostAndJoinGame" type="Label" parent="HBoxContainer/VBoxContainer/MenuOptions"] +margin_top = 213.0 +margin_right = 112.0 +margin_bottom = 227.0 +mouse_filter = 1 +text = "Host / Join Game" +script = ExtResource( 2 ) + +[node name="Player Settings" type="Label" parent="HBoxContainer/VBoxContainer/MenuOptions"] +margin_top = 257.0 +margin_right = 112.0 +margin_bottom = 271.0 +mouse_filter = 1 +text = "Player Settings" +script = ExtResource( 1 ) + +[node name="CenterContainer" type="CenterContainer" parent="HBoxContainer"] +margin_left = 116.0 +margin_right = 784.0 +margin_bottom = 440.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="HBoxContainer/CenterContainer"] +margin_left = 300.0 +margin_top = 213.0 +margin_right = 367.0 +margin_bottom = 227.0 +text = "Test Menu" +[connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/Start Game" to="HBoxContainer/VBoxContainer/MenuOptions/Start Game" method="_on_Start_Game_gui_input"] +[connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/HostAndJoinGame" to="HBoxContainer/VBoxContainer/MenuOptions/HostAndJoinGame" method="_on_HostAndJoinGame_gui_input"] +[connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/Player Settings" to="HBoxContainer/VBoxContainer/MenuOptions/Player Settings" method="_on_Player_Settings_gui_input"] diff --git a/GodotUI/HostAndJoinGame.gd b/GodotUI/HostAndJoinGame.gd new file mode 100644 index 0000000..19421bf --- /dev/null +++ b/GodotUI/HostAndJoinGame.gd @@ -0,0 +1,21 @@ +extends Label + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass + + +func _on_HostAndJoinGame_gui_input(event): + if (event is InputEventMouseButton && event.pressed && event.button_index == 1): + print("Clicked Host and Join Game") diff --git a/GodotUI/Player_Settings_Button.gd b/GodotUI/Player_Settings_Button.gd new file mode 100644 index 0000000..854ea8e --- /dev/null +++ b/GodotUI/Player_Settings_Button.gd @@ -0,0 +1,24 @@ +extends Label + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" +func _unhandled_input(event): + if event is InputEventKey: + if event.pressed and event.scancode == KEY_ESCAPE: + get_tree().quit() + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass + + +func _on_Player_Settings_gui_input(event): + if (event is InputEventMouseButton && event.pressed && event.button_index == 1): + print("Clicked Player Settings") diff --git a/GodotUI/Start Game.gd b/GodotUI/Start Game.gd new file mode 100644 index 0000000..ecb92f7 --- /dev/null +++ b/GodotUI/Start Game.gd @@ -0,0 +1,17 @@ +extends Label +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + +var option = 0 + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +func _on_Start_Game_gui_input(event): + if (event is InputEventMouseButton && event.pressed && event.button_index == 1): + print("Clicked Start Game") + get_tree().change_scene("res://TestNode2D.tscn") + # Start Game button opens a new node for that purpose + diff --git a/GodotUI/TestNode2D.gd b/GodotUI/TestNode2D.gd new file mode 100644 index 0000000..ab3aef4 --- /dev/null +++ b/GodotUI/TestNode2D.gd @@ -0,0 +1,23 @@ +extends Node2D + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" +var isPaused = false + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +# Make this function return a boolean. +func _isPaused(): + if isPaused == true: + print("Unpaused") + if isPaused == false: + print("Paused") + return isPaused + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass diff --git a/GodotUI/TestNode2D.tscn b/GodotUI/TestNode2D.tscn new file mode 100644 index 0000000..31caea0 --- /dev/null +++ b/GodotUI/TestNode2D.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://TestNode2D.gd" type="Script" id=1] + +[node name="Node2D" type="Node2D"] +script = ExtResource( 1 ) + +[node name="Label" type="Label" parent="."] +margin_right = 40.0 +margin_bottom = 14.0 +text = "Game Started Node" +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/GodotUI/default_env.tres b/GodotUI/default_env.tres new file mode 100644 index 0000000..20207a4 --- /dev/null +++ b/GodotUI/default_env.tres @@ -0,0 +1,7 @@ +[gd_resource type="Environment" load_steps=2 format=2] + +[sub_resource type="ProceduralSky" id=1] + +[resource] +background_mode = 2 +background_sky = SubResource( 1 ) diff --git a/GodotUI/icon.png b/GodotUI/icon.png new file mode 100644 index 0000000..c98fbb6 Binary files /dev/null and b/GodotUI/icon.png differ diff --git a/GodotUI/icon.png.import b/GodotUI/icon.png.import new file mode 100644 index 0000000..96cbf46 --- /dev/null +++ b/GodotUI/icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.png" +dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/GodotUI/project.godot b/GodotUI/project.godot new file mode 100644 index 0000000..b10e18c --- /dev/null +++ b/GodotUI/project.godot @@ -0,0 +1,27 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=4 + +_global_script_classes=[ ] +_global_script_class_icons={ + +} + +[application] + +config/name="Godot Ui" +run/main_scene="res://GUI.tscn" +config/icon="res://icon.png" + +[rendering] + +quality/driver/driver_name="GLES2" +vram_compression/import_etc=true +vram_compression/import_etc2=false +environment/default_environment="res://default_env.tres"