added basic framework
This commit is contained in:
parent
fe6af41d47
commit
f55f728e44
2 changed files with 41 additions and 1 deletions
|
@ -1,8 +1,9 @@
|
||||||
[gd_scene load_steps=14 format=3 uid="uid://ba6afuig8bqrg"]
|
[gd_scene load_steps=15 format=3 uid="uid://ba6afuig8bqrg"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://snxpqx0ony7s" path="res://objects/Player.tscn" id="1_prjlb"]
|
[ext_resource type="PackedScene" uid="uid://snxpqx0ony7s" path="res://objects/Player.tscn" id="1_prjlb"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_mxtem"]
|
[ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_mxtem"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cw3onignoce3e" path="res://temp_assets/scale_up.png" id="3_7s458"]
|
[ext_resource type="Texture2D" uid="uid://cw3onignoce3e" path="res://temp_assets/scale_up.png" id="3_7s458"]
|
||||||
|
[ext_resource type="Script" path="res://scripts/ui_actions.gd" id="3_b82rx"]
|
||||||
[ext_resource type="Texture2D" uid="uid://ckr5hxaqp6s5x" path="res://temp_assets/scale_up_hovered.png" id="4_6s82a"]
|
[ext_resource type="Texture2D" uid="uid://ckr5hxaqp6s5x" path="res://temp_assets/scale_up_hovered.png" id="4_6s82a"]
|
||||||
[ext_resource type="Texture2D" uid="uid://btmck3gpinxo1" path="res://temp_assets/scaled_down.png" id="5_8tyx1"]
|
[ext_resource type="Texture2D" uid="uid://btmck3gpinxo1" path="res://temp_assets/scaled_down.png" id="5_8tyx1"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c02aqv5sgwvgn" path="res://temp_assets/scale_down_hovered.png" id="6_kdplq"]
|
[ext_resource type="Texture2D" uid="uid://c02aqv5sgwvgn" path="res://temp_assets/scale_down_hovered.png" id="6_kdplq"]
|
||||||
|
@ -39,6 +40,7 @@ anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
|
script = ExtResource("3_b82rx")
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="UILayer/UI"]
|
[node name="HBoxContainer" type="HBoxContainer" parent="UILayer/UI"]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
|
@ -90,3 +92,7 @@ shape = SubResource("RectangleShape2D_nnio8")
|
||||||
[node name="RightWall" type="CollisionShape2D" parent="Walls"]
|
[node name="RightWall" type="CollisionShape2D" parent="Walls"]
|
||||||
position = Vector2(690, -2.5)
|
position = Vector2(690, -2.5)
|
||||||
shape = SubResource("RectangleShape2D_h7316")
|
shape = SubResource("RectangleShape2D_h7316")
|
||||||
|
|
||||||
|
[connection signal="pressed" from="UILayer/UI/HBoxContainer/ScaleUp" to="UILayer/UI" method="select_up"]
|
||||||
|
[connection signal="pressed" from="UILayer/UI/HBoxContainer/ScaleDown" to="UILayer/UI" method="select_down"]
|
||||||
|
[connection signal="pressed" from="UILayer/UI/HBoxContainer/TextureButton" to="UILayer/UI" method="select_mirror"]
|
||||||
|
|
34
gmtk_2024/scripts/ui_actions.gd
Normal file
34
gmtk_2024/scripts/ui_actions.gd
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
@export var player : CharacterBody2D;
|
||||||
|
|
||||||
|
var current_selected = "none";
|
||||||
|
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
if Input.is_action_just_pressed("click"):
|
||||||
|
if current_selected == "scale_up":
|
||||||
|
scale_up()
|
||||||
|
elif current_selected == "scale_down":
|
||||||
|
scale_down()
|
||||||
|
elif current_selected == "mirror":
|
||||||
|
mirror();
|
||||||
|
|
||||||
|
|
||||||
|
func select_up():
|
||||||
|
current_selected = "scale_up"
|
||||||
|
|
||||||
|
func select_down():
|
||||||
|
current_selected = "scale_down"
|
||||||
|
|
||||||
|
func select_mirror():
|
||||||
|
current_selected = "mirror"
|
||||||
|
|
||||||
|
func scale_up():
|
||||||
|
pass #Hir hochscalieren einbauen
|
||||||
|
|
||||||
|
func scale_down():
|
||||||
|
pass #Hir runterscalieren einbauen
|
||||||
|
|
||||||
|
func mirror():
|
||||||
|
pass #Hir mirror einbauen einbauen
|
Loading…
Add table
Reference in a new issue