Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to menus #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions assets/menu/Button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions assets/menu/Button.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cccput2yhxp23"
path="res://.godot/imported/Button.svg-bc76a7c1df35e00d72e5f21a26cd54aa.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/menu/Button.svg"
dest_files=["res://.godot/imported/Button.svg-bc76a7c1df35e00d72e5f21a26cd54aa.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
20 changes: 19 additions & 1 deletion icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 65 additions & 28 deletions scenes/MainMenu.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://c8f42e3aor2xs"]
[gd_scene load_steps=4 format=3 uid="uid://c8f42e3aor2xs"]

[ext_resource type="Script" path="res://scripts/MainMenu.gd" id="1_l6q04"]
[ext_resource type="Texture2D" uid="uid://bimoas6i2ns8c" path="res://assets/menu/Main-menu_art.png" id="2_i1nyp"]
[ext_resource type="Texture2D" uid="uid://cccput2yhxp23" path="res://assets/menu/Button.svg" id="3_wo0r0"]

[node name="MainMenu" type="Control"]
layout_mode = 3
Expand All @@ -21,40 +22,76 @@ grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_i1nyp")

[node name="PanelContainer" type="PanelContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -23.0
offset_top = -33.0
offset_right = 23.0
offset_bottom = 33.0
grow_horizontal = 2
grow_vertical = 2
[node name="TITLE" type="TextureRect" parent="."]
layout_mode = 0
offset_right = 399.0
offset_bottom = 304.0

[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
offset_left = 9.0
offset_top = 251.0
offset_right = 279.0
offset_bottom = 397.0

[node name="StartButton" type="Button" parent="PanelContainer/VBoxContainer"]
[node name="StartButton" type="TextureButton" parent="VBoxContainer"]
layout_mode = 2
text = "Start"
texture_normal = ExtResource("3_wo0r0")

[node name="RichTextLabel" type="RichTextLabel" parent="VBoxContainer/StartButton"]
modulate = Color(0, 0, 0, 1)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 81.0
offset_top = 12.0
offset_right = -95.0
offset_bottom = -7.0
grow_horizontal = 2
grow_vertical = 2
bbcode_enabled = true
text = "[center]Start Game[/center]"

[node name="Controls" type="Button" parent="PanelContainer/VBoxContainer"]
[node name="controls" type="TextureButton" parent="VBoxContainer"]
layout_mode = 2
text = "Controls"
texture_normal = ExtResource("3_wo0r0")

[node name="QuitButton" type="Button" parent="PanelContainer/VBoxContainer"]
[node name="RichTextLabel" type="RichTextLabel" parent="VBoxContainer/controls"]
modulate = Color(0, 0, 0, 1)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 96.0
offset_top = 10.0
offset_right = -100.0
offset_bottom = -13.0
grow_horizontal = 2
grow_vertical = 2
bbcode_enabled = true
text = "[center]Controls
[/center]"

[node name="quit" type="TextureButton" parent="VBoxContainer"]
layout_mode = 2
text = "Quit"
texture_normal = ExtResource("3_wo0r0")

[node name="TITLE" type="TextureRect" parent="."]
layout_mode = 0
offset_right = 399.0
offset_bottom = 304.0
[node name="RichTextLabel" type="RichTextLabel" parent="VBoxContainer/quit"]
modulate = Color(0, 0, 0, 1)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 99.0
offset_top = 11.0
offset_right = -106.0
offset_bottom = -8.0
grow_horizontal = 2
grow_vertical = 2
bbcode_enabled = true
text = "[center]Quit[/center]"

[connection signal="pressed" from="PanelContainer/VBoxContainer/StartButton" to="." method="_on_start_button_pressed"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/Controls" to="." method="_on_controls_pressed"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/QuitButton" to="." method="_on_quit_button_pressed"]
[connection signal="pressed" from="VBoxContainer/StartButton" to="." method="_on_start_button_pressed"]
[connection signal="pressed" from="VBoxContainer/controls" to="." method="_on_controls_pressed"]
[connection signal="pressed" from="VBoxContainer/quit" to="." method="_on_quit_pressed"]
28 changes: 22 additions & 6 deletions scenes/control_menu.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://bh3m1426pcjo5"]
[gd_scene load_steps=5 format=3 uid="uid://bh3m1426pcjo5"]

[ext_resource type="Script" path="res://scripts/control_menu.gd" id="1_r0eje"]
[ext_resource type="Texture2D" uid="uid://8bbf4bhnxo3b" path="res://assets/player/Zesh.png" id="2_7inh3"]
[ext_resource type="Texture2D" uid="uid://cccput2yhxp23" path="res://assets/menu/Button.svg" id="2_ax2qo"]

[sub_resource type="Theme" id="Theme_4e7xn"]

Expand All @@ -27,14 +28,29 @@ layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = 604.0
offset_right = -1024.0
offset_left = 2.0
offset_top = 603.0
offset_right = -880.0
offset_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Back" type="Button" parent="VBoxContainer"]
[node name="TextureButton" type="TextureButton" parent="VBoxContainer"]
layout_mode = 2
text = "BACK"
texture_normal = ExtResource("2_ax2qo")

[node name="RichTextLabel" type="RichTextLabel" parent="VBoxContainer/TextureButton"]
layout_mode = 1
anchors_preset = -1
anchor_top = -13.109
anchor_right = 4.259
anchor_bottom = 1.0
offset_left = 112.0
offset_top = 615.014
offset_right = -981.93
offset_bottom = -1.0
bbcode_enabled = true
text = "Back"

[node name="RichTextLabel" type="RichTextLabel" parent="."]
layout_mode = 1
Expand Down Expand Up @@ -86,4 +102,4 @@ grow_vertical = 2
theme = SubResource("Theme_4e7xn")
text = "Zesh"

[connection signal="pressed" from="VBoxContainer/Back" to="." method="_on_back_pressed"]
[connection signal="pressed" from="VBoxContainer/TextureButton" to="." method="_on_texture_button_pressed"]
20 changes: 5 additions & 15 deletions scripts/MainMenu.gd
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
extends Control


# 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_start_button_pressed():
var scene = load("res://scenes/tilemap.tscn")
func _on_controls_pressed():
var scene = load("res://scenes/control_menu.tscn")
get_tree().change_scene_to_packed(scene)
pass # Replace with function body.

func _on_start_button_pressed():
var scene = load("res://Level1.tscn")

func _on_quit_button_pressed():
func _on_quit_pressed():
get_tree().quit()
pass # Replace with function body.


func _on_controls_pressed():
var scene = load("res://scenes/control_menu.tscn")
get_tree().change_scene_to_packed(scene)
2 changes: 1 addition & 1 deletion scripts/control_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ func _process(delta):
pass


func _on_back_pressed():
func _on_texture_button_pressed():
var scene = load("res://scenes/MainMenu.tscn")
get_tree().change_scene_to_packed(scene)