From 8f920f93b9a4923476a1aa7b4f7c452a1408af7a Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 26 Feb 2023 13:12:38 +0100 Subject: [PATCH] * Add cursors, background and new buttons * Start implementation of desktop --- Assets/cursor/0.png | 3 ++ Assets/cursor/0.png.import | 35 +++++++++++++++++++ Assets/dossier/0.png | 3 ++ Assets/dossier/0.png.import | 35 +++++++++++++++++++ Assets/tres_button/hover-pressed.png | 3 ++ Assets/tres_button/hover-pressed.png.import | 35 +++++++++++++++++++ Assets/tres_button/hover.tres | 4 +-- Assets/tres_button/normal.png | 3 ++ Assets/tres_button/normal.png.import | 35 +++++++++++++++++++ Assets/tres_button/normal.tres | 4 +-- Assets/tres_button/pressed.tres | 4 +-- Assets/windows/folder_rect.png | 3 ++ Assets/windows/folder_rect.png.import | 35 +++++++++++++++++++ Assets/windows/folder_square.png | 3 ++ Assets/windows/folder_square.png.import | 35 +++++++++++++++++++ Assets/windows/window.png | 3 ++ Assets/windows/window.png.import | 35 +++++++++++++++++++ Assets/{ => windows}/windows.png | 0 Assets/{ => windows}/windows.png.import | 6 ++-- Elements/Directory.tscn | 14 ++++---- Elements/Scripts/Directory.gd | 11 +++--- Elements/Scripts/WindowHeader.gd | 33 ++++++++++++++++++ Elements/SquareWindow.tscn | 37 +++++++++++++++++++++ Scenes/DesktopScreen.tscn | 21 ++++++++---- Scenes/Scripts/Button_Node2D.gd | 4 +-- Scenes/gameover.tscn | 13 ++++---- Scenes/menu.tscn | 12 ++++--- project.godot | 1 + 28 files changed, 391 insertions(+), 39 deletions(-) create mode 100755 Assets/cursor/0.png create mode 100755 Assets/cursor/0.png.import create mode 100755 Assets/dossier/0.png create mode 100755 Assets/dossier/0.png.import create mode 100755 Assets/tres_button/hover-pressed.png create mode 100755 Assets/tres_button/hover-pressed.png.import mode change 100644 => 100755 Assets/tres_button/hover.tres create mode 100755 Assets/tres_button/normal.png create mode 100755 Assets/tres_button/normal.png.import mode change 100644 => 100755 Assets/tres_button/pressed.tres create mode 100755 Assets/windows/folder_rect.png create mode 100755 Assets/windows/folder_rect.png.import create mode 100755 Assets/windows/folder_square.png create mode 100755 Assets/windows/folder_square.png.import create mode 100755 Assets/windows/window.png create mode 100755 Assets/windows/window.png.import rename Assets/{ => windows}/windows.png (100%) rename Assets/{ => windows}/windows.png.import (72%) create mode 100755 Elements/Scripts/WindowHeader.gd create mode 100755 Elements/SquareWindow.tscn diff --git a/Assets/cursor/0.png b/Assets/cursor/0.png new file mode 100755 index 0000000..50044be --- /dev/null +++ b/Assets/cursor/0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:091b507885cc8715b446af2cbcdc2f4471ee62214bd8a9fccc470d5d838e1a55 +size 10929 diff --git a/Assets/cursor/0.png.import b/Assets/cursor/0.png.import new file mode 100755 index 0000000..5765b37 --- /dev/null +++ b/Assets/cursor/0.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/0.png-ad7a3593a89f071404b09ff08bb62570.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/cursor/0.png" +dest_files=[ "res://.import/0.png-ad7a3593a89f071404b09ff08bb62570.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/dossier/0.png b/Assets/dossier/0.png new file mode 100755 index 0000000..b15e22e --- /dev/null +++ b/Assets/dossier/0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cfbf130aca4845aac818715cd5d860ba05675f1edf14cfdeaf8f73698bbe637 +size 8648 diff --git a/Assets/dossier/0.png.import b/Assets/dossier/0.png.import new file mode 100755 index 0000000..aa09e83 --- /dev/null +++ b/Assets/dossier/0.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/0.png-985ff1ad14ce5f7ec8f8dfba86ab0336.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/dossier/0.png" +dest_files=[ "res://.import/0.png-985ff1ad14ce5f7ec8f8dfba86ab0336.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/tres_button/hover-pressed.png b/Assets/tres_button/hover-pressed.png new file mode 100755 index 0000000..8a9dcf3 --- /dev/null +++ b/Assets/tres_button/hover-pressed.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a32f8a21a5aad1e4b5f49867cd5076a3d2d9605e10ca7644088e389739f526c6 +size 13006 diff --git a/Assets/tres_button/hover-pressed.png.import b/Assets/tres_button/hover-pressed.png.import new file mode 100755 index 0000000..7283c23 --- /dev/null +++ b/Assets/tres_button/hover-pressed.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/hover-pressed.png-5db228aeb72be547570753afdd6b9dd0.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/tres_button/hover-pressed.png" +dest_files=[ "res://.import/hover-pressed.png-5db228aeb72be547570753afdd6b9dd0.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/tres_button/hover.tres b/Assets/tres_button/hover.tres old mode 100644 new mode 100755 index 92c434d..d8be105 --- a/Assets/tres_button/hover.tres +++ b/Assets/tres_button/hover.tres @@ -1,10 +1,10 @@ [gd_resource type="StyleBoxTexture" load_steps=2 format=2] -[ext_resource path="res://Assets/skin_assets/button_focus.png" type="Texture" id=1] +[ext_resource path="res://Assets/tres_button/hover-pressed.png" type="Texture" id=1] [resource] texture = ExtResource( 1 ) -region_rect = Rect2( 0, 0, 16, 16 ) +region_rect = Rect2( 0, 0, 730, 204 ) margin_left = 10.0 margin_right = 10.0 margin_top = 2.0 diff --git a/Assets/tres_button/normal.png b/Assets/tres_button/normal.png new file mode 100755 index 0000000..dfde1a1 --- /dev/null +++ b/Assets/tres_button/normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b77a3058b56140e723652733150412fd7ef624dea765010c25d89d49ca817a7c +size 14464 diff --git a/Assets/tres_button/normal.png.import b/Assets/tres_button/normal.png.import new file mode 100755 index 0000000..06485e3 --- /dev/null +++ b/Assets/tres_button/normal.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/normal.png-74e29cb12c30af4f08c2651cbb3e7413.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/tres_button/normal.png" +dest_files=[ "res://.import/normal.png-74e29cb12c30af4f08c2651cbb3e7413.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/tres_button/normal.tres b/Assets/tres_button/normal.tres index 988d7fc..7a75ec9 100755 --- a/Assets/tres_button/normal.tres +++ b/Assets/tres_button/normal.tres @@ -1,10 +1,10 @@ [gd_resource type="StyleBoxTexture" load_steps=2 format=2] -[ext_resource path="res://Assets/skin_assets/button_normal.png" type="Texture" id=1] +[ext_resource path="res://Assets/tres_button/normal.png" type="Texture" id=1] [resource] texture = ExtResource( 1 ) -region_rect = Rect2( 0, 0, 16, 16 ) +region_rect = Rect2( 0, 0, 730, 204 ) margin_left = 10.0 margin_right = 10.0 margin_top = 2.0 diff --git a/Assets/tres_button/pressed.tres b/Assets/tres_button/pressed.tres old mode 100644 new mode 100755 index 5060202..d8be105 --- a/Assets/tres_button/pressed.tres +++ b/Assets/tres_button/pressed.tres @@ -1,10 +1,10 @@ [gd_resource type="StyleBoxTexture" load_steps=2 format=2] -[ext_resource path="res://Assets/skin_assets/button_pressed.png" type="Texture" id=1] +[ext_resource path="res://Assets/tres_button/hover-pressed.png" type="Texture" id=1] [resource] texture = ExtResource( 1 ) -region_rect = Rect2( 0, 0, 16, 16 ) +region_rect = Rect2( 0, 0, 730, 204 ) margin_left = 10.0 margin_right = 10.0 margin_top = 2.0 diff --git a/Assets/windows/folder_rect.png b/Assets/windows/folder_rect.png new file mode 100755 index 0000000..324c5eb --- /dev/null +++ b/Assets/windows/folder_rect.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c1edd25a5d5910661f6b1c4cfca6b3ff707bc335450371764e5820ff48f4e67 +size 12652 diff --git a/Assets/windows/folder_rect.png.import b/Assets/windows/folder_rect.png.import new file mode 100755 index 0000000..9b21df7 --- /dev/null +++ b/Assets/windows/folder_rect.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/folder_rect.png-17052b7a49b8f69b8895c390b42733ef.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/windows/folder_rect.png" +dest_files=[ "res://.import/folder_rect.png-17052b7a49b8f69b8895c390b42733ef.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/windows/folder_square.png b/Assets/windows/folder_square.png new file mode 100755 index 0000000..32397f1 --- /dev/null +++ b/Assets/windows/folder_square.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d23aded4ad415b6107220a159149297919c8bad48cffe72988f35c70183b0780 +size 15090 diff --git a/Assets/windows/folder_square.png.import b/Assets/windows/folder_square.png.import new file mode 100755 index 0000000..c4f363d --- /dev/null +++ b/Assets/windows/folder_square.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/folder_square.png-86e02f3453993f39b52d1d2a794d5b1f.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/windows/folder_square.png" +dest_files=[ "res://.import/folder_square.png-86e02f3453993f39b52d1d2a794d5b1f.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/windows/window.png b/Assets/windows/window.png new file mode 100755 index 0000000..ecdb3dc --- /dev/null +++ b/Assets/windows/window.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d397f910c5f9d93e6890b02f7c1e66c6af6cfc801ada4571ac537a5e2d1e906 +size 687103 diff --git a/Assets/windows/window.png.import b/Assets/windows/window.png.import new file mode 100755 index 0000000..1835fac --- /dev/null +++ b/Assets/windows/window.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/window.png-4acdb702967ff791135e29cc39d693da.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/windows/window.png" +dest_files=[ "res://.import/window.png-4acdb702967ff791135e29cc39d693da.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/windows.png b/Assets/windows/windows.png similarity index 100% rename from Assets/windows.png rename to Assets/windows/windows.png diff --git a/Assets/windows.png.import b/Assets/windows/windows.png.import similarity index 72% rename from Assets/windows.png.import rename to Assets/windows/windows.png.import index ec21f03..fbf0da1 100755 --- a/Assets/windows.png.import +++ b/Assets/windows/windows.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/windows.png-57bc7ca67ed2fd90bf67137af0c36b14.stex" +path="res://.import/windows.png-63993ca9c59f37e0ad00b5a6a909cb20.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/windows.png" -dest_files=[ "res://.import/windows.png-57bc7ca67ed2fd90bf67137af0c36b14.stex" ] +source_file="res://Assets/windows/windows.png" +dest_files=[ "res://.import/windows.png-63993ca9c59f37e0ad00b5a6a909cb20.stex" ] [params] diff --git a/Elements/Directory.tscn b/Elements/Directory.tscn index 42a5fc1..e58eb09 100755 --- a/Elements/Directory.tscn +++ b/Elements/Directory.tscn @@ -1,19 +1,19 @@ [gd_scene load_steps=3 format=2] +[ext_resource path="res://Assets/dossier/0.png" type="Texture" id=1] [ext_resource path="res://Elements/Scripts/Directory.gd" type="Script" id=2] -[sub_resource type="RectangleShape2D" id=1] - [node name="Node2D" type="Node2D"] +z_index = 3 [node name="Sprite" type="Sprite" parent="."] -scale = Vector2( 1.5, 1.5 ) +scale = Vector2( 0.1, 0.1 ) +texture = ExtResource( 1 ) [node name="Area2D" type="Area2D" parent="."] script = ExtResource( 2 ) -[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] -shape = SubResource( 1 ) +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Area2D"] +polygon = PoolVector2Array( -29, -23, -13, -23, -13, -27, -9, -27, -9, -31, -4, -31, -4, -35, 17, -35, 17, -31, 29, -31, 29, -27, 33, -27, 33, -15, 38, -15, 38, -11, 42, -11, 42, -2, 37, -2, 37, 11, 33, 11, 33, 23, 29, 23, 29, 27, 21, 27, 21, 31, 4, 31, 4, 35, -29, 35, -29, 31, -33, 31, -33, 19, -37, 19, -37, -2, -42, -2, -42, -15, -37, -15, -37, -19, -29, -19 ) -[connection signal="mouse_entered" from="Area2D" to="Area2D" method="_on_Area2D_mouse_entered"] -[connection signal="mouse_exited" from="Area2D" to="Area2D" method="_on_Area2D_mouse_exited"] +[connection signal="input_event" from="Area2D" to="Area2D" method="_on_Area2D_input_event"] diff --git a/Elements/Scripts/Directory.gd b/Elements/Scripts/Directory.gd index 4d469b1..66ffca0 100755 --- a/Elements/Scripts/Directory.gd +++ b/Elements/Scripts/Directory.gd @@ -1,9 +1,10 @@ extends Area2D - -func _on_Area2D_mouse_entered() -> void: - Input.set_default_cursor_shape(Input.CURSOR_POINTING_HAND) +onready var screen = $"../Screen" -func _on_Area2D_mouse_exited() -> void: - Input.set_default_cursor_shape(Input.CURSOR_ARROW) +func _on_Area2D_input_event(_viewport: Node, event: InputEvent, _shape_idx: int) -> void: + if event is InputEventMouseButton: + event = event as InputEventMouseButton + if event.pressed and event.button_index == BUTTON_LEFT: + screen.visible = true diff --git a/Elements/Scripts/WindowHeader.gd b/Elements/Scripts/WindowHeader.gd new file mode 100755 index 0000000..4c8c301 --- /dev/null +++ b/Elements/Scripts/WindowHeader.gd @@ -0,0 +1,33 @@ +extends Area2D + +var is_dragging = false +var grabbed_offset = Vector2() + +onready var window = $"../.." + + +func drag_change_state(): + is_dragging = !is_dragging + grabbed_offset = window.get_position() - get_global_mouse_position() + + +func _process(_delta) -> void: + if is_dragging: + window.set_position(get_global_mouse_position() + grabbed_offset) + + +func _on_Area2D_input_event(_viewport: Node, event: InputEvent, _shape_idx: int) -> void: + if event is InputEventMouseButton: + event = event as InputEventMouseButton + if event.pressed and event.button_index == BUTTON_LEFT: + drag_change_state() + elif event.button_index == BUTTON_LEFT and !event.pressed: + drag_change_state() + + +func _on_Area2D2_input_event(_viewport: Node, event: InputEvent, _shape_idx: int) -> void: + if event is InputEventMouseButton: + event = event as InputEventMouseButton + if event.pressed and event.button_index == BUTTON_LEFT: + drag_change_state() + window.visible = !window.visible diff --git a/Elements/SquareWindow.tscn b/Elements/SquareWindow.tscn new file mode 100755 index 0000000..93a0724 --- /dev/null +++ b/Elements/SquareWindow.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://Assets/windows/folder_square.png" type="Texture" id=1] +[ext_resource path="res://Elements/Scripts/WindowHeader.gd" type="Script" id=2] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 555, 60 ) + +[sub_resource type="RectangleShape2D" id=2] +extents = Vector2( 38.75, 38.75 ) + +[node name="Node2D" type="Node2D"] + +[node name="Window" type="Sprite" parent="."] +scale = Vector2( 0.4, 0.4 ) +z_index = -3 +texture = ExtResource( 1 ) + +[node name="Area2D" type="Area2D" parent="Window"] +position = Vector2( 487.5, -490 ) +script = ExtResource( 2 ) + +[node name="Header" type="CollisionShape2D" parent="Window/Area2D"] +position = Vector2( -487.5, 2.5 ) +scale = Vector2( 0.999999, 0.999999 ) +shape = SubResource( 1 ) + +[node name="Area2D2" type="Area2D" parent="Window"] +script = ExtResource( 2 ) + +[node name="CloseButton" type="CollisionShape2D" parent="Window/Area2D2"] +position = Vector2( 486.25, -486.25 ) +scale = Vector2( 1, 1 ) +shape = SubResource( 2 ) + +[connection signal="input_event" from="Window/Area2D" to="Window/Area2D" method="_on_Area2D_input_event"] +[connection signal="input_event" from="Window/Area2D2" to="Window/Area2D" method="_on_Area2D2_input_event"] diff --git a/Scenes/DesktopScreen.tscn b/Scenes/DesktopScreen.tscn index 70138ae..531b657 100755 --- a/Scenes/DesktopScreen.tscn +++ b/Scenes/DesktopScreen.tscn @@ -1,12 +1,14 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://Characters/Villain.tscn" type="PackedScene" id=1] +[ext_resource path="res://Elements/Directory.tscn" type="PackedScene" id=2] [ext_resource path="res://Scenes/Scripts/Button_Node2D.gd" type="Script" id=3] [ext_resource path="res://Assets/tres_button/normal.tres" type="StyleBox" id=4] [ext_resource path="res://Assets/tres_button/pressed.tres" type="StyleBox" id=5] [ext_resource path="res://Assets/tres_button/hover.tres" type="StyleBox" id=6] -[ext_resource path="res://Assets/windows.png" type="Texture" id=7] +[ext_resource path="res://Assets/windows/windows.png" type="Texture" id=7] [ext_resource path="res://Assets/skin_assets/menu_font.tres" type="DynamicFont" id=8] +[ext_resource path="res://Elements/SquareWindow.tscn" type="PackedScene" id=9] [sub_resource type="Theme" id=1] @@ -19,13 +21,13 @@ z_index = -3 texture = ExtResource( 7 ) [node name="Button" type="Button" parent="."] -margin_left = 431.0 -margin_top = 349.0 +margin_left = 374.0 +margin_top = 317.0 margin_right = 651.0 margin_bottom = 386.0 theme = SubResource( 1 ) -custom_colors/font_color_disabled = Color( 0, 0, 0, 1 ) -custom_colors/font_color = Color( 0.34902, 0.313726, 0.313726, 1 ) +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_colors/font_color_hover = Color( 0.941176, 0.690196, 0.403922, 1 ) custom_fonts/font = ExtResource( 8 ) custom_styles/hover = ExtResource( 6 ) custom_styles/pressed = ExtResource( 5 ) @@ -39,4 +41,11 @@ scale = Vector2( 0.2, 0.2 ) [node name="Directories" type="Node2D" parent="."] +[node name="Directory1" parent="Directories" instance=ExtResource( 2 )] +position = Vector2( 73, 147 ) + +[node name="Screen" parent="Directories/Directory1" instance=ExtResource( 9 )] +visible = false +position = Vector2( 396, 195 ) + [connection signal="pressed" from="Button" to="Button" method="_on_Button_pressed"] diff --git a/Scenes/Scripts/Button_Node2D.gd b/Scenes/Scripts/Button_Node2D.gd index d74e6bc..c821f0c 100755 --- a/Scenes/Scripts/Button_Node2D.gd +++ b/Scenes/Scripts/Button_Node2D.gd @@ -4,8 +4,8 @@ onready var villain = $"../Villain/AnimatedSprite" onready var villain_animations = $"../Villain".animations var etat = false -const texture_pressed = preload("res://Assets/skin_assets/button_normal.png") -const texture_released = preload("res://Assets/skin_assets/button_pressed.png") +const texture_pressed = preload("res://Assets/tres_button/hover-pressed.png") +const texture_released = preload("res://Assets/tres_button/normal.png") # Called every frame. '_delta' is the elapsed time since the previous frame. diff --git a/Scenes/gameover.tscn b/Scenes/gameover.tscn index f95c28d..570c42e 100755 --- a/Scenes/gameover.tscn +++ b/Scenes/gameover.tscn @@ -5,7 +5,7 @@ [ext_resource path="res://Assets/tres_button/normal.tres" type="StyleBox" id=3] [ext_resource path="res://Assets/tres_button/pressed.tres" type="StyleBox" id=4] [ext_resource path="res://Assets/tres_button/hover.tres" type="StyleBox" id=5] -[ext_resource path="res://Assets/windows.png" type="Texture" id=6] +[ext_resource path="res://Assets/windows/windows.png" type="Texture" id=6] [node name="Node2D" type="Node2D"] script = ExtResource( 1 ) @@ -25,11 +25,12 @@ custom_fonts/font = ExtResource( 2 ) text = "GAME OVER" [node name="RestartButton" type="Button" parent="."] -margin_left = 340.0 -margin_top = 378.0 -margin_right = 700.0 -margin_bottom = 415.0 -custom_colors/font_color = Color( 0.34902, 0.313726, 0.313726, 1 ) +margin_left = 312.0 +margin_top = 384.0 +margin_right = 724.0 +margin_bottom = 445.0 +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_colors/font_color_hover = Color( 0.941176, 0.690196, 0.403922, 1 ) custom_fonts/font = ExtResource( 2 ) custom_styles/hover = ExtResource( 5 ) custom_styles/pressed = ExtResource( 4 ) diff --git a/Scenes/menu.tscn b/Scenes/menu.tscn index 1f24059..3a3f97d 100755 --- a/Scenes/menu.tscn +++ b/Scenes/menu.tscn @@ -5,12 +5,13 @@ [ext_resource path="res://Assets/tres_button/normal.tres" type="StyleBox" id=3] [ext_resource path="res://Assets/tres_button/pressed.tres" type="StyleBox" id=4] [ext_resource path="res://Assets/tres_button/hover.tres" type="StyleBox" id=5] -[ext_resource path="res://Assets/windows.png" type="Texture" id=6] +[ext_resource path="res://Assets/windows/window.png" type="Texture" id=6] [node name="Node2D" type="Node2D"] [node name="Windows" type="Sprite" parent="."] position = Vector2( 512, 360 ) +scale = Vector2( 0.5, 0.5 ) z_index = -2 texture = ExtResource( 6 ) @@ -32,7 +33,8 @@ alignment = 1 [node name="PlayButton" type="Button" parent="MenuButton/VBoxContainer"] margin_right = 100.0 margin_bottom = 37.0 -custom_colors/font_color = Color( 0.34902, 0.313726, 0.313726, 1 ) +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_colors/font_color_hover = Color( 0.941176, 0.690196, 0.403922, 1 ) custom_fonts/font = ExtResource( 2 ) custom_styles/hover = ExtResource( 5 ) custom_styles/pressed = ExtResource( 4 ) @@ -43,7 +45,8 @@ text = "PLAY" margin_top = 63.0 margin_right = 100.0 margin_bottom = 100.0 -custom_colors/font_color = Color( 0.34902, 0.313726, 0.313726, 1 ) +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_colors/font_color_hover = Color( 0.941176, 0.690196, 0.403922, 1 ) custom_fonts/font = ExtResource( 2 ) custom_styles/hover = ExtResource( 5 ) custom_styles/pressed = ExtResource( 4 ) @@ -54,7 +57,8 @@ text = "HELP" margin_top = 126.0 margin_right = 100.0 margin_bottom = 163.0 -custom_colors/font_color = Color( 0.34902, 0.313726, 0.313726, 1 ) +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_colors/font_color_hover = Color( 0.941176, 0.690196, 0.403922, 1 ) custom_fonts/font = ExtResource( 2 ) custom_styles/hover = ExtResource( 5 ) custom_styles/pressed = ExtResource( 4 ) diff --git a/project.godot b/project.godot index b218456..fefa692 100755 --- a/project.godot +++ b/project.godot @@ -18,6 +18,7 @@ config/icon="res://icon.png" window/size/height=720 window/size/resizable=false +mouse_cursor/custom_image="res://Assets/cursor/0.png" [gui]