From 0a532de9107ccd48864213ebb17f39df1037e4a0 Mon Sep 17 00:00:00 2001 From: OddlyTimbot Date: Mon, 12 Aug 2024 17:45:20 -0400 Subject: [PATCH] ui example --- week6/example/UIDemo/.gitattributes | 2 + week6/example/UIDemo/.gitignore | 2 + .../UIDemo/graphics/Player Idle 48x48.png | Bin 0 -> 1853 bytes .../graphics/Player Idle 48x48.png.import | 34 +++ .../UIDemo/graphics/player run 48x48.png | Bin 0 -> 3199 bytes .../graphics/player run 48x48.png.import | 34 +++ week6/example/UIDemo/icon.svg | 1 + week6/example/UIDemo/icon.svg.import | 37 ++++ week6/example/UIDemo/main.tscn | 199 ++++++++++++++++++ week6/example/UIDemo/project.godot | 21 ++ week6/example/UIDemo/scripts/uicontrols.gd | 29 +++ week6/example/UIDemo/themes/basic_flat.tres | 12 ++ week6/example/UIDemo/themes/basic_theme.tres | 14 ++ week6/example/UIDemo/themes/button_flat.tres | 8 + 14 files changed, 393 insertions(+) create mode 100644 week6/example/UIDemo/.gitattributes create mode 100644 week6/example/UIDemo/.gitignore create mode 100644 week6/example/UIDemo/graphics/Player Idle 48x48.png create mode 100644 week6/example/UIDemo/graphics/Player Idle 48x48.png.import create mode 100644 week6/example/UIDemo/graphics/player run 48x48.png create mode 100644 week6/example/UIDemo/graphics/player run 48x48.png.import create mode 100644 week6/example/UIDemo/icon.svg create mode 100644 week6/example/UIDemo/icon.svg.import create mode 100644 week6/example/UIDemo/main.tscn create mode 100644 week6/example/UIDemo/project.godot create mode 100644 week6/example/UIDemo/scripts/uicontrols.gd create mode 100644 week6/example/UIDemo/themes/basic_flat.tres create mode 100644 week6/example/UIDemo/themes/basic_theme.tres create mode 100644 week6/example/UIDemo/themes/button_flat.tres diff --git a/week6/example/UIDemo/.gitattributes b/week6/example/UIDemo/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/week6/example/UIDemo/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/week6/example/UIDemo/.gitignore b/week6/example/UIDemo/.gitignore new file mode 100644 index 0000000..4709183 --- /dev/null +++ b/week6/example/UIDemo/.gitignore @@ -0,0 +1,2 @@ +# Godot 4+ specific ignores +.godot/ diff --git a/week6/example/UIDemo/graphics/Player Idle 48x48.png b/week6/example/UIDemo/graphics/Player Idle 48x48.png new file mode 100644 index 0000000000000000000000000000000000000000..b618511699269f9bd10ff834f6b382e147588ebd GIT binary patch literal 1853 zcma)7_g9k%7X30{KoA&uC&-k*2m(V}iiV98siI(^NQA(IG9>gOk_3>BBH$vuD&Qj0 zI|zutNC=Ul^rDWTh5#RBW5}0Z;id z0D!HW)LQ)TllZ>qrSM6Dh1{@21Fy#v)&T&1WM%eGr^rIaB8?#7EyK6Nbb3T-b(Qi9 z@b#CjK%>(Gp1cawwlgV<%ZmI`{@Js?c9fa+O`30QKn z&+sZ~v0+J1(Lfg1ne4(UQpF`e_K~L-=Dh`*_s2~4yA!0s+1dw}vR;TC2RIxU>xLj{;*R8j77@10XAu$?wdl)rA^c$Yi(opzgK>%z zXlNW1h(?gJl}r_y8Ksx1eM^;cQRnkFdTqXE93tu3q=FMR0ym+0`DJx6&}P2XkR}y% z_Do=U*?$^VodIz8N(hm9P}jrV-?lF6ZgppqvYR5*-Shi9&LR6E?W) z2TU|K#7iOjWO7mPe9*s+#Nez_cRiwsUz5bwb8u^`iF8j}iF06*`1`u^b_xrGo*MiQ z;kXHMMT4&EyA#&zo5+mmpab0ZB#=lpKbvl(k`0g+I)zh>|AhGKyhWh z*-i42H!1RA1OjP4CIH*ehRbNDDuHdtMxH>7Q9?>Qn@7lWM1{XIKC#q%>(A01*3aT< zLQh%QRUMEqyokC<7cmfWdP8$eqa62U2CJ1W9>CB=#IPK zoIlWU+Cz*FBuUX%)=e>SE!V0*Cyno=q8oJ#6dHXO}{nMM;!qc|BkNNty5-4~yF zi#|bE+@t;x{QGaK;#b8LK(@G*HUzFplPPHRQTG5DGABqxQ{8NLr)-pSSN zm)vT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>v8 zd30Sbd)eLYhltO?{XW&S@1(lQ!R<+Kj*#FdT0Ea~yB;a>2p9fM{`*)0U(>}xDSKq5 z)8*au-nEiU!Z+V}^|>oXweHC7pD3{>T_f$MIJGV)_-VGJ;8)b7BbjGPzW;t6z36i- zE!9tJOeasOndQ*=p-%Z5b0_*^zKK0*;Gz>mF`jBsrh-uGabKpX>i2W8J;+m69*F8a z6C*aprH~}3p{E-0${^A7#sRRl&1Sdcd3;RSahG^t_Abg?!*tPs`;|IFrm`Pr*{5ai z!VtL_;cn$QHB5DX$)r!I+j*fSF*ZN&^BL^j1oK%c0ExR0x?+;xMwC8y#x^%Mueh_2 zl-vy+8MYzo6x);!DmlA|r>MN-94(Ms)e1Ok@tCFH7q>Q3&A{o>8$apnoqxI_!m<~m zhBM~>@C#2^xQb4=Jh!zDyG0IFNCqYfO1u~yeJ3L&IochrJz{Ca*vQhh? zW_}Av(1LbjYB?MEeA+18F~xKjp{7IyqhxK!(PWi_+6Ti#9v&Xn4`POH4n;m+Lk%<^#MQn9S^(1@J3 zZlg7tAI}f^1;J3o8h5cn!?`9lkF+or9Q7+-Si%q$0;61#wf7&QFSxyF|M3Bf8SF-} zw7q~81r8G9)Xj-*W}uk0`7EuDyIKrQ0c>mMzy~8L%+QgGNkGQ51&&xQtXbH6{qI$4 zxACe8b3>AO+8KdFPP?c!Qx9gYw!{6GrS z==WVi3O>3E@SB%Kn^*OE3k&fXn!6bYx=$O!|Bp+2x^9*+7ox)Z{G!>$$wvVg>fg~T I)3Fc#A5dKsJ^%m! literal 0 HcmV?d00001 diff --git a/week6/example/UIDemo/graphics/player run 48x48.png.import b/week6/example/UIDemo/graphics/player run 48x48.png.import new file mode 100644 index 0000000..656f800 --- /dev/null +++ b/week6/example/UIDemo/graphics/player run 48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cm1woggnuul4l" +path="res://.godot/imported/player run 48x48.png-626defb011aee5b3f5c54d9acb45d5f5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/player run 48x48.png" +dest_files=["res://.godot/imported/player run 48x48.png-626defb011aee5b3f5c54d9acb45d5f5.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 diff --git a/week6/example/UIDemo/icon.svg b/week6/example/UIDemo/icon.svg new file mode 100644 index 0000000..b370ceb --- /dev/null +++ b/week6/example/UIDemo/icon.svg @@ -0,0 +1 @@ + diff --git a/week6/example/UIDemo/icon.svg.import b/week6/example/UIDemo/icon.svg.import new file mode 100644 index 0000000..3e8aca1 --- /dev/null +++ b/week6/example/UIDemo/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bpxaclgteuqnl" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.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 diff --git a/week6/example/UIDemo/main.tscn b/week6/example/UIDemo/main.tscn new file mode 100644 index 0000000..f726c75 --- /dev/null +++ b/week6/example/UIDemo/main.tscn @@ -0,0 +1,199 @@ +[gd_scene load_steps=24 format=3 uid="uid://2imtdevb7dgp"] + +[ext_resource type="Script" path="res://scripts/uicontrols.gd" id="1_jdye0"] +[ext_resource type="Theme" uid="uid://c1bv8x07p5hcq" path="res://themes/basic_theme.tres" id="1_rased"] +[ext_resource type="Texture2D" uid="uid://b1jefdr3xicmi" path="res://graphics/Player Idle 48x48.png" id="3_8gddj"] +[ext_resource type="Texture2D" uid="uid://cm1woggnuul4l" path="res://graphics/player run 48x48.png" id="4_feex0"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_2g7pn"] +atlas = ExtResource("3_8gddj") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_lkww2"] +atlas = ExtResource("3_8gddj") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_op60x"] +atlas = ExtResource("3_8gddj") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_u4y5s"] +atlas = ExtResource("3_8gddj") +region = Rect2(144, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8iwh7"] +atlas = ExtResource("3_8gddj") +region = Rect2(192, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_e1wx7"] +atlas = ExtResource("3_8gddj") +region = Rect2(240, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hi7vn"] +atlas = ExtResource("3_8gddj") +region = Rect2(288, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ljcxo"] +atlas = ExtResource("3_8gddj") +region = Rect2(336, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3vbn3"] +atlas = ExtResource("3_8gddj") +region = Rect2(384, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3jbx1"] +atlas = ExtResource("3_8gddj") +region = Rect2(432, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_632tr"] +atlas = ExtResource("4_feex0") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_16llu"] +atlas = ExtResource("4_feex0") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1h853"] +atlas = ExtResource("4_feex0") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_g3x76"] +atlas = ExtResource("4_feex0") +region = Rect2(144, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ojjof"] +atlas = ExtResource("4_feex0") +region = Rect2(192, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vsvld"] +atlas = ExtResource("4_feex0") +region = Rect2(240, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wyf10"] +atlas = ExtResource("4_feex0") +region = Rect2(288, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_76v8x"] +atlas = ExtResource("4_feex0") +region = Rect2(336, 0, 48, 48) + +[sub_resource type="SpriteFrames" id="SpriteFrames_ykw1q"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_2g7pn") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_lkww2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_op60x") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_u4y5s") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8iwh7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_e1wx7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hi7vn") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ljcxo") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3vbn3") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3jbx1") +}], +"loop": true, +"name": &"idle", +"speed": 15.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_632tr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_16llu") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1h853") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_g3x76") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ojjof") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vsvld") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wyf10") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_76v8x") +}], +"loop": true, +"name": &"run", +"speed": 15.0 +}] + +[node name="CenterContainer" type="CenterContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_jdye0") + +[node name="PanelContainer" type="PanelContainer" parent="."] +custom_minimum_size = Vector2(400, 0) +layout_mode = 2 +theme = ExtResource("1_rased") + +[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] +layout_mode = 2 +theme = ExtResource("1_rased") + +[node name="Label" type="Label" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 +theme = ExtResource("1_rased") +text = "MAIN MENU" +horizontal_alignment = 1 + +[node name="NewGameButton" type="Button" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 +theme = ExtResource("1_rased") +text = "New Game" + +[node name="ContinueButton" type="Button" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 +text = "Continue" + +[node name="SettingsButton" type="Button" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 +text = "Settings" + +[node name="QuitButton" type="Button" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 +text = "Quit" + +[node name="Control" type="Control" parent="PanelContainer/VBoxContainer"] +custom_minimum_size = Vector2(0, 120) +layout_mode = 2 + +[node name="Node2D" type="Node2D" parent="PanelContainer/VBoxContainer/Control"] +texture_filter = 1 +position = Vector2(150, 42) +scale = Vector2(2, 2) + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="PanelContainer/VBoxContainer/Control/Node2D"] +sprite_frames = SubResource("SpriteFrames_ykw1q") +animation = &"run" +autoplay = "idle" diff --git a/week6/example/UIDemo/project.godot b/week6/example/UIDemo/project.godot new file mode 100644 index 0000000..ba34059 --- /dev/null +++ b/week6/example/UIDemo/project.godot @@ -0,0 +1,21 @@ +; 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=5 + +[application] + +config/name="UIDemo-CustomTheme" +run/main_scene="res://main.tscn" +config/features=PackedStringArray("4.2", "Forward Plus") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=600 +window/size/viewport_height=600 diff --git a/week6/example/UIDemo/scripts/uicontrols.gd b/week6/example/UIDemo/scripts/uicontrols.gd new file mode 100644 index 0000000..add3e73 --- /dev/null +++ b/week6/example/UIDemo/scripts/uicontrols.gd @@ -0,0 +1,29 @@ +extends CenterContainer +@onready var new_game_button = $PanelContainer/VBoxContainer/NewGameButton as Button +@onready var continue_button = $PanelContainer/VBoxContainer/ContinueButton as Button +@onready var settings_button = $PanelContainer/VBoxContainer/SettingsButton as Button +@onready var quit_button = $PanelContainer/VBoxContainer/QuitButton as Button +@onready var animated_sprite_2d = $PanelContainer/VBoxContainer/Control/Node2D/AnimatedSprite2D + + +# Called when the node enters the scene tree for the first time. +func _ready(): + new_game_button.button_down.connect(on_button_down) + new_game_button.mouse_entered.connect(on_button_entered) + new_game_button.mouse_exited.connect(on_button_exited) + + continue_button.button_down.connect(on_button_down) + settings_button.button_down.connect(on_button_down) + quit_button.button_down.connect(on_exit_pressed) + +func on_button_down(): + print("button pressed down ") + +func on_button_entered(): + animated_sprite_2d.play("run") +func on_button_exited(): + animated_sprite_2d.play("idle") + +func on_exit_pressed(): + print("attempting to quit game") + get_tree().quit() diff --git a/week6/example/UIDemo/themes/basic_flat.tres b/week6/example/UIDemo/themes/basic_flat.tres new file mode 100644 index 0000000..975c091 --- /dev/null +++ b/week6/example/UIDemo/themes/basic_flat.tres @@ -0,0 +1,12 @@ +[gd_resource type="StyleBoxFlat" format=3 uid="uid://rug1bma4m4p3"] + +[resource] +content_margin_left = 50.0 +content_margin_top = 50.0 +content_margin_right = 50.0 +content_margin_bottom = 50.0 +bg_color = Color(0.117647, 0.117647, 0.117647, 0.819608) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 diff --git a/week6/example/UIDemo/themes/basic_theme.tres b/week6/example/UIDemo/themes/basic_theme.tres new file mode 100644 index 0000000..56ab415 --- /dev/null +++ b/week6/example/UIDemo/themes/basic_theme.tres @@ -0,0 +1,14 @@ +[gd_resource type="Theme" load_steps=4 format=3 uid="uid://c1bv8x07p5hcq"] + +[ext_resource type="StyleBox" uid="uid://bvppr1mi3251g" path="res://themes/button_flat.tres" id="1_22x2v"] +[ext_resource type="StyleBox" uid="uid://rug1bma4m4p3" path="res://themes/basic_flat.tres" id="2_ls5x7"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_g1o25"] +content_margin_bottom = 20.0 + +[resource] +Button/styles/normal = ExtResource("1_22x2v") +Label/font_sizes/font_size = 22 +Label/styles/normal = SubResource("StyleBoxEmpty_g1o25") +PanelContainer/styles/panel = ExtResource("2_ls5x7") +VBoxContainer/constants/separation = 15 diff --git a/week6/example/UIDemo/themes/button_flat.tres b/week6/example/UIDemo/themes/button_flat.tres new file mode 100644 index 0000000..761c391 --- /dev/null +++ b/week6/example/UIDemo/themes/button_flat.tres @@ -0,0 +1,8 @@ +[gd_resource type="StyleBoxFlat" format=3 uid="uid://bvppr1mi3251g"] + +[resource] +content_margin_left = 15.0 +content_margin_top = 15.0 +content_margin_right = 15.0 +content_margin_bottom = 15.0 +bg_color = Color(0.25098, 0.25098, 0.25098, 1)