added a keyboard panel and a toggle button
This commit is contained in:
@@ -34,6 +34,8 @@ _data = {
|
||||
|
||||
[node name="AGUIButtonBase3D" type="Node3D" unique_id=81597797]
|
||||
script = ExtResource("1_1du0n")
|
||||
baseColor = Color(0.3961465, 0.0014402646, 0.94223887, 1)
|
||||
pressedColor = Color(0.70962924, 0.38504785, 0.12277315, 1)
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=1473098479]
|
||||
collision_layer = 2
|
||||
|
||||
72
AGUI.CharacterButton3D.tscn
Normal file
72
AGUI.CharacterButton3D.tscn
Normal file
@@ -0,0 +1,72 @@
|
||||
[gd_scene format=3 uid="uid://bcm2gnlwsvvd3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://3m5f4lxd2x3c" path="res://AgainstGravityUI/AGUI.Scripts/AGUI.CharacterButton3D.gd" id="1_glpbs"]
|
||||
[ext_resource type="Script" uid="uid://dbv4hr2h4cfug" path="res://AgainstGravityUI/AGUI.Scripts/AGUI.CharacterButton3D.Collider.gd" id="2_708ma"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_xeeyd"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_1du0n"]
|
||||
length = 0.001
|
||||
tracks/0/type = "position_3d"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("StaticBody3D/MeshRoot")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_xjbij"]
|
||||
resource_name = "interact"
|
||||
length = 0.1
|
||||
tracks/0/type = "position_3d"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("StaticBody3D/MeshRoot")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0, 0.03333334, 1, 0, -0.05, 0)
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_7pntp"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_1du0n"),
|
||||
&"interact": SubResource("Animation_xjbij")
|
||||
}
|
||||
|
||||
[node name="AGUIIconButton3D" type="Node3D" unique_id=81597797]
|
||||
script = ExtResource("1_glpbs")
|
||||
baseColor = Color(0.52195215, 0.08105264, 0.9999997, 1)
|
||||
pressedColor = Color(0.3094211, 0.50286317, 1, 1)
|
||||
char = "?"
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=1473098479]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
script = ExtResource("2_708ma")
|
||||
|
||||
[node name="Collider" type="CollisionShape3D" parent="StaticBody3D" unique_id=335334790]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.011110017, 0, 0, 0, 1, 0, 0, 0)
|
||||
shape = SubResource("BoxShape3D_xeeyd")
|
||||
|
||||
[node name="MeshRoot" type="CSGCombiner3D" parent="StaticBody3D" unique_id=1112723183]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.024529457, 0, 0, 0, 1, 0, 0, 0)
|
||||
operation = 2
|
||||
|
||||
[node name="MainMesh" type="CSGBox3D" parent="StaticBody3D/MeshRoot" unique_id=1438018078]
|
||||
|
||||
[node name="Subtractor_Box" type="CSGBox3D" parent="StaticBody3D/MeshRoot/MainMesh" unique_id=842962794]
|
||||
operation = 2
|
||||
|
||||
[node name="Subtractor_Cylinder" type="CSGCylinder3D" parent="StaticBody3D/MeshRoot/MainMesh/Subtractor_Box" unique_id=1951089581]
|
||||
transform = Transform3D(0.9, 0, 0, 0, 0.9, 0, 0, 0, 0.9, 0, 0, 0)
|
||||
operation = 2
|
||||
radius = 0.734
|
||||
|
||||
[node name="Animator" type="AnimationPlayer" parent="StaticBody3D" unique_id=53081295]
|
||||
root_node = NodePath("../..")
|
||||
libraries/ = SubResource("AnimationLibrary_7pntp")
|
||||
|
||||
[node name="Label3D" type="Label3D" parent="StaticBody3D" unique_id=1429557569]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 0.024055064, 0)
|
||||
text = "?"
|
||||
font_size = 128
|
||||
outline_size = 0
|
||||
69
AGUI.IconButton3D.tscn
Normal file
69
AGUI.IconButton3D.tscn
Normal file
@@ -0,0 +1,69 @@
|
||||
[gd_scene format=3 uid="uid://f4tj743a8ym3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dkmw6hfq1nkrk" path="res://AgainstGravityUI/AGUI.Scripts/AGUI.IconButton3D.gd" id="1_rhqs2"]
|
||||
[ext_resource type="Script" uid="uid://crq0dvryyehig" path="res://AgainstGravityUI/AGUI.Scripts/AGUI.IconButton3D.Collider.gd" id="2_e4tim"]
|
||||
[ext_resource type="Texture2D" uid="uid://lu0kocwkk08d" path="res://assets/inquire.svg" id="3_rhqs2"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_xeeyd"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_1du0n"]
|
||||
length = 0.001
|
||||
tracks/0/type = "position_3d"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("StaticBody3D/MeshRoot")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_xjbij"]
|
||||
resource_name = "interact"
|
||||
length = 0.1
|
||||
tracks/0/type = "position_3d"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("StaticBody3D/MeshRoot")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0, 0.03333334, 1, 0, -0.05, 0)
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_7pntp"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_1du0n"),
|
||||
&"interact": SubResource("Animation_xjbij")
|
||||
}
|
||||
|
||||
[node name="AGUIIconButton3D" type="Node3D" unique_id=81597797]
|
||||
script = ExtResource("1_rhqs2")
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=1473098479]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
script = ExtResource("2_e4tim")
|
||||
|
||||
[node name="Collider" type="CollisionShape3D" parent="StaticBody3D" unique_id=335334790]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.011110017, 0, 0, 0, 1, 0, 0, 0)
|
||||
shape = SubResource("BoxShape3D_xeeyd")
|
||||
|
||||
[node name="MeshRoot" type="CSGCombiner3D" parent="StaticBody3D" unique_id=1112723183]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.024529457, 0, 0, 0, 1, 0, 0, 0)
|
||||
operation = 2
|
||||
|
||||
[node name="MainMesh" type="CSGBox3D" parent="StaticBody3D/MeshRoot" unique_id=1438018078]
|
||||
|
||||
[node name="Subtractor_Box" type="CSGBox3D" parent="StaticBody3D/MeshRoot/MainMesh" unique_id=842962794]
|
||||
operation = 2
|
||||
|
||||
[node name="Subtractor_Cylinder" type="CSGCylinder3D" parent="StaticBody3D/MeshRoot/MainMesh/Subtractor_Box" unique_id=1951089581]
|
||||
transform = Transform3D(0.9, 0, 0, 0, 0.9, 0, 0, 0, 0.9, 0, 0, 0)
|
||||
operation = 2
|
||||
radius = 0.734
|
||||
|
||||
[node name="Animator" type="AnimationPlayer" parent="StaticBody3D" unique_id=53081295]
|
||||
root_node = NodePath("../..")
|
||||
libraries/ = SubResource("AnimationLibrary_7pntp")
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="StaticBody3D" unique_id=1459504000]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 0.014697313, 0)
|
||||
pixel_size = 0.001
|
||||
texture = ExtResource("3_rhqs2")
|
||||
37
AGUI.Panels/AGUIKeyboard.gd
Normal file
37
AGUI.Panels/AGUIKeyboard.gd
Normal file
@@ -0,0 +1,37 @@
|
||||
extends Node3D
|
||||
|
||||
signal isFinished(text) ## enter button
|
||||
|
||||
var text = ""
|
||||
var isShift = false
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
func typeText(char:Variant):
|
||||
if char == "<=":
|
||||
if text.length() != 0:
|
||||
text = text.substr(0, text.length()-1)
|
||||
elif char == "Shift":
|
||||
return
|
||||
elif isShift:
|
||||
text += char.to_upper()
|
||||
else:
|
||||
text += char
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
$Label3D.text = text
|
||||
|
||||
|
||||
func _on_shift_button_pressed(char: Variant) -> void:
|
||||
isShift = true
|
||||
|
||||
|
||||
func _on_shift_button_released() -> void:
|
||||
isShift = false
|
||||
|
||||
|
||||
func _on_return_button_pressed(char: Variant) -> void:
|
||||
isFinished.emit(text)
|
||||
1
AGUI.Panels/AGUIKeyboard.gd.uid
Normal file
1
AGUI.Panels/AGUIKeyboard.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cmjkjm6xol5kq
|
||||
412
AGUI.Panels/AGUIKeyboard.tscn
Normal file
412
AGUI.Panels/AGUIKeyboard.tscn
Normal file
@@ -0,0 +1,412 @@
|
||||
[gd_scene format=3 uid="uid://dndni0d5ta0vi"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cmjkjm6xol5kq" path="res://AgainstGravityUI/AGUI.Panels/AGUIKeyboard.gd" id="1_53dpa"]
|
||||
[ext_resource type="Script" uid="uid://bghaddibpt6f1" path="res://addons/crt/crt.gd" id="1_lvoud"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcm2gnlwsvvd3" path="res://AgainstGravityUI/AGUI.CharacterButton3D.tscn" id="2_igafl"]
|
||||
[ext_resource type="PackedScene" uid="uid://bigr5fyb4o6pr" path="res://AgainstGravityUI/AGUI.ToggleCharacterButton3D.tscn" id="4_2q8pl"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_igafl"]
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_53dpa"]
|
||||
viewport_path = NodePath("ScanEffect")
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2q8pl"]
|
||||
resource_local_to_scene = true
|
||||
transparency = 1
|
||||
albedo_color = Color(0.88142926, 0, 0.12755448, 0.80784315)
|
||||
albedo_texture = SubResource("ViewportTexture_53dpa")
|
||||
|
||||
[node name="AGUIKeyboard" type="Node3D" unique_id=878355930]
|
||||
script = ExtResource("1_53dpa")
|
||||
|
||||
[node name="Label3D" type="Label3D" parent="." unique_id=804713225]
|
||||
transform = Transform3D(0.5, 0, 0, 0, -2.1855694e-08, 0.5, 0, -0.5, -2.1855694e-08, 0, 0.0032993406, -0.22048534)
|
||||
|
||||
[node name="ScanEffect" type="SubViewport" parent="." unique_id=55142127]
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="ScanEffect" unique_id=547947411]
|
||||
|
||||
[node name="CRT" type="CanvasLayer" parent="ScanEffect/CanvasLayer" unique_id=544121509]
|
||||
script = ExtResource("1_lvoud")
|
||||
warp_amount = 0.0
|
||||
interference_amount = 0.0
|
||||
grille_amount = 0.0
|
||||
vignette_intensity = 0.094
|
||||
pixel_strength = 0.0
|
||||
metadata/_custom_type_script = "uid://bghaddibpt6f1"
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=718626547]
|
||||
transform = Transform3D(-0.9400148, 0, 0, 0, -0.008133411, 0, 0, 0, -0.50687003, 0, 0, 0)
|
||||
mesh = SubResource("BoxMesh_igafl")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_2q8pl")
|
||||
|
||||
[node name="NumRow" type="Node3D" parent="." unique_id=819164547]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.097414374, 0, 0)
|
||||
|
||||
[node name="backtick" parent="NumRow" unique_id=81597797 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.4741231, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "`"
|
||||
|
||||
[node name="1" parent="NumRow" unique_id=1676326805 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.42000398, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "1"
|
||||
|
||||
[node name="2" parent="NumRow" unique_id=1023718799 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.36490083, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "2"
|
||||
|
||||
[node name="3" parent="NumRow" unique_id=1299791527 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.3107817, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "3"
|
||||
|
||||
[node name="4" parent="NumRow" unique_id=1292243420 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.25567853, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "4"
|
||||
|
||||
[node name="5" parent="NumRow" unique_id=1870405645 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.20155945, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "5"
|
||||
|
||||
[node name="6" parent="NumRow" unique_id=1114011997 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.1464563, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "6"
|
||||
|
||||
[node name="7" parent="NumRow" unique_id=696375040 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.09233716, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "7"
|
||||
|
||||
[node name="8" parent="NumRow" unique_id=319040837 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.03723401, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "8"
|
||||
|
||||
[node name="9" parent="NumRow" unique_id=1111409783 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.017869085, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "9"
|
||||
|
||||
[node name="0" parent="NumRow" unique_id=332451061 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.07297224, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "0"
|
||||
|
||||
[node name="dash" parent="NumRow" unique_id=1618513816 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.12807536, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "-"
|
||||
|
||||
[node name="equals" parent="NumRow" unique_id=1698248141 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.18219447, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30723473, 0.7217335, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "="
|
||||
|
||||
[node name="bksp" parent="NumRow" unique_id=1359623185 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.1038687, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.26583305, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.7027028, 0.1791189, 0.99999994, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "<="
|
||||
|
||||
[node name="AlphaRow1" type="Node3D" parent="." unique_id=1064396112]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.14451808, 0, 0.06815003)
|
||||
|
||||
[node name="q" parent="AlphaRow1" unique_id=151296729 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.4741231, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "q"
|
||||
|
||||
[node name="w" parent="AlphaRow1" unique_id=1635796714 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.42000398, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "w"
|
||||
|
||||
[node name="e" parent="AlphaRow1" unique_id=1376426781 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.36490083, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "e"
|
||||
|
||||
[node name="r" parent="AlphaRow1" unique_id=2079145329 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.3107817, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "r"
|
||||
|
||||
[node name="t" parent="AlphaRow1" unique_id=1507521840 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.25567853, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "t"
|
||||
|
||||
[node name="y" parent="AlphaRow1" unique_id=1349434045 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.20155945, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "y"
|
||||
|
||||
[node name="u" parent="AlphaRow1" unique_id=514573250 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.1464563, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "u"
|
||||
|
||||
[node name="i" parent="AlphaRow1" unique_id=815055796 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.09233716, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "i"
|
||||
|
||||
[node name="o" parent="AlphaRow1" unique_id=420362446 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.03723401, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "o"
|
||||
|
||||
[node name="p" parent="AlphaRow1" unique_id=453193189 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.017869085, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "p"
|
||||
|
||||
[node name="[" parent="AlphaRow1" unique_id=1193794684 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.07297224, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30588236, 0.72156864, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "["
|
||||
|
||||
[node name="]" parent="AlphaRow1" unique_id=1250148392 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.12807536, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30588236, 0.72156864, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "]"
|
||||
|
||||
[node name="\\" parent="AlphaRow1" unique_id=615441384 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.18219447, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30588236, 0.72156864, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "\\"
|
||||
|
||||
[node name="Shift" parent="." unique_id=1726776584 instance=ExtResource("4_2q8pl")]
|
||||
transform = Transform3D(0.10446443, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.39323136, 0.009753257, 0.044096336)
|
||||
baseColor = Color(0.30588236, 0.72156864, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "↑"
|
||||
|
||||
[node name="AlphaRow2" type="Node3D" parent="." unique_id=1181150051]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.16857105, 0, 0.12828241)
|
||||
|
||||
[node name="a" parent="AlphaRow2" unique_id=807868705 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.4741231, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "a"
|
||||
|
||||
[node name="s" parent="AlphaRow2" unique_id=1390295138 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.42000398, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "s"
|
||||
|
||||
[node name="d" parent="AlphaRow2" unique_id=1357108938 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.36490083, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "d"
|
||||
|
||||
[node name="f" parent="AlphaRow2" unique_id=267022216 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.3107817, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "f"
|
||||
|
||||
[node name="g" parent="AlphaRow2" unique_id=615436635 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.25567853, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "g"
|
||||
|
||||
[node name="h" parent="AlphaRow2" unique_id=1715521052 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.20155945, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "h"
|
||||
|
||||
[node name="j" parent="AlphaRow2" unique_id=370330055 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.1464563, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "j"
|
||||
|
||||
[node name="k" parent="AlphaRow2" unique_id=1497102976 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.09233716, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "k"
|
||||
|
||||
[node name="l" parent="AlphaRow2" unique_id=815382307 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.03723401, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "l"
|
||||
|
||||
[node name=";" parent="AlphaRow2" unique_id=52813521 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.017869085, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30588236, 0.72156864, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = ";"
|
||||
|
||||
[node name="\'" parent="AlphaRow2" unique_id=1068602007 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.07297224, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30588236, 0.72156864, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "'"
|
||||
|
||||
[node name="return" parent="AlphaRow2" unique_id=1445286046 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.102339216, 0, 0, 0, 0.05, 0, 0, 0, 0.05179743, 0.17264289, 0.009753257, -0.1504994)
|
||||
baseColor = Color(0.7027028, 0.1791189, 0.99999994, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "↩ "
|
||||
|
||||
[node name="AlphaRow3" type="Node3D" parent="." unique_id=1858551428]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.20379943, 0, 0.18413241)
|
||||
|
||||
[node name="z" parent="AlphaRow3" unique_id=22530716 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.4741231, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "z"
|
||||
|
||||
[node name="x" parent="AlphaRow3" unique_id=548883705 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.42000398, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "x"
|
||||
|
||||
[node name="c" parent="AlphaRow3" unique_id=1005583554 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.36490083, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "c"
|
||||
|
||||
[node name="v" parent="AlphaRow3" unique_id=1083315149 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.3107817, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "v"
|
||||
|
||||
[node name="b" parent="AlphaRow3" unique_id=1510412177 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.25567853, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "b"
|
||||
|
||||
[node name="n" parent="AlphaRow3" unique_id=1032086807 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.20155945, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "n"
|
||||
|
||||
[node name="m" parent="AlphaRow3" unique_id=201982873 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.1464563, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "m"
|
||||
|
||||
[node name="," parent="AlphaRow3" unique_id=1572028798 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.09233716, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30588236, 0.72156864, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = ","
|
||||
|
||||
[node name="dot" parent="AlphaRow3" unique_id=1339357905 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.03723401, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30588236, 0.72156864, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "."
|
||||
|
||||
[node name="fslash" parent="AlphaRow3" unique_id=44035835 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.017869085, 0.009753257, -0.15135863)
|
||||
baseColor = Color(0.30588236, 0.72156864, 1, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = "/"
|
||||
|
||||
[node name="space" parent="." unique_id=209057000 instance=ExtResource("2_igafl")]
|
||||
transform = Transform3D(0.43769312, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.014434785, 0.009753257, 0.10383284)
|
||||
baseColor = Color(0.5407738, 0.003902634, 0.99892515, 1)
|
||||
pressedColor = Color(0.82398, 0.40454915, 0.1814934, 1)
|
||||
char = " "
|
||||
|
||||
[connection signal="buttonPressed" from="NumRow/backtick" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/1" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/2" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/3" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/4" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/5" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/6" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/7" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/8" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/9" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/0" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/dash" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/equals" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="NumRow/bksp" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/q" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/w" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/e" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/r" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/t" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/y" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/u" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/i" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/o" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/p" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/[" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/]" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow1/\\" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="Shift" to="." method="_on_shift_button_pressed"]
|
||||
[connection signal="buttonReleased" from="Shift" to="." method="_on_shift_button_released"]
|
||||
[connection signal="buttonPressed" from="AlphaRow2/a" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow2/s" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow2/d" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow2/f" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow2/g" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow2/h" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow2/j" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow2/k" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow2/l" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow2/;" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow2/\'" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow2/return" to="." method="_on_return_button_pressed"]
|
||||
[connection signal="buttonPressed" from="AlphaRow3/z" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow3/x" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow3/c" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow3/v" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow3/b" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow3/n" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow3/m" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow3/," to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow3/dot" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="AlphaRow3/fslash" to="." method="typeText"]
|
||||
[connection signal="buttonPressed" from="space" to="." method="typeText"]
|
||||
@@ -1,3 +1,4 @@
|
||||
@tool
|
||||
extends Node3D
|
||||
|
||||
signal buttonPressed
|
||||
@@ -8,6 +9,7 @@ signal buttonUpdated
|
||||
@export var baseColor : Color
|
||||
@export var pressedColor : Color
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
$StaticBody3D._initButton(baseColor,pressedColor)
|
||||
print(baseColor,pressedColor)
|
||||
|
||||
35
AGUI.Scripts/AGUI.CharacterButton3D.Collider.gd
Normal file
35
AGUI.Scripts/AGUI.CharacterButton3D.Collider.gd
Normal file
@@ -0,0 +1,35 @@
|
||||
extends StaticBody3D
|
||||
|
||||
var baseColor : Color
|
||||
var pressedColor : Color
|
||||
@onready var Animator = $Animator
|
||||
var pressed : bool = false
|
||||
var ButtonMaterial : StandardMaterial3D = StandardMaterial3D.new()
|
||||
|
||||
func _initButton(BaseColor:Color,PressedColor:Color,char:String):
|
||||
baseColor=BaseColor
|
||||
pressedColor=PressedColor
|
||||
ButtonMaterial.albedo_color = BaseColor
|
||||
$Label3D.text = char
|
||||
|
||||
func _ready() -> void:
|
||||
|
||||
$MeshRoot.material_override = ButtonMaterial
|
||||
ButtonMaterial.albedo_color = baseColor
|
||||
Animator.get_animation("interact").loop_mode = Animation.LOOP_NONE
|
||||
|
||||
func press():
|
||||
if !pressed:
|
||||
$"..".buttonPressed.emit($Label3D.text)
|
||||
$"..".buttonUpdated.emit()
|
||||
Animator.play("interact")
|
||||
ButtonMaterial.albedo_color = pressedColor
|
||||
pressed=true
|
||||
|
||||
func release():
|
||||
if pressed:
|
||||
$"..".buttonReleased.emit()
|
||||
$"..".buttonUpdated.emit()
|
||||
Animator.play_backwards("interact")
|
||||
ButtonMaterial.albedo_color = baseColor
|
||||
pressed=false
|
||||
1
AGUI.Scripts/AGUI.CharacterButton3D.Collider.gd.uid
Normal file
1
AGUI.Scripts/AGUI.CharacterButton3D.Collider.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dbv4hr2h4cfug
|
||||
17
AGUI.Scripts/AGUI.CharacterButton3D.gd
Normal file
17
AGUI.Scripts/AGUI.CharacterButton3D.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
@tool
|
||||
extends Node3D
|
||||
|
||||
signal buttonPressed(char)
|
||||
signal buttonReleased
|
||||
signal buttonUpdated
|
||||
|
||||
@export_category("Visuals")
|
||||
@export var baseColor : Color
|
||||
@export var pressedColor : Color
|
||||
@export var char : String
|
||||
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
$StaticBody3D._initButton(baseColor,pressedColor,char)
|
||||
print(baseColor,pressedColor)
|
||||
1
AGUI.Scripts/AGUI.CharacterButton3D.gd.uid
Normal file
1
AGUI.Scripts/AGUI.CharacterButton3D.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://3m5f4lxd2x3c
|
||||
35
AGUI.Scripts/AGUI.IconButton3D.Collider.gd
Normal file
35
AGUI.Scripts/AGUI.IconButton3D.Collider.gd
Normal file
@@ -0,0 +1,35 @@
|
||||
extends StaticBody3D
|
||||
|
||||
var baseColor : Color
|
||||
var pressedColor : Color
|
||||
@onready var Animator = $Animator
|
||||
var pressed : bool = false
|
||||
var ButtonMaterial : StandardMaterial3D = StandardMaterial3D.new()
|
||||
|
||||
func _initButton(BaseColor:Color,PressedColor:Color,icon:Texture2D):
|
||||
baseColor=BaseColor
|
||||
pressedColor=PressedColor
|
||||
ButtonMaterial.albedo_color = BaseColor
|
||||
$Sprite3D.texture = icon
|
||||
|
||||
func _ready() -> void:
|
||||
|
||||
$MeshRoot.material_override = ButtonMaterial
|
||||
ButtonMaterial.albedo_color = baseColor
|
||||
Animator.get_animation("interact").loop_mode = Animation.LOOP_NONE
|
||||
|
||||
func press():
|
||||
if !pressed:
|
||||
$"..".buttonPressed.emit()
|
||||
$"..".buttonUpdated.emit()
|
||||
Animator.play("interact")
|
||||
ButtonMaterial.albedo_color = pressedColor
|
||||
pressed=true
|
||||
|
||||
func release():
|
||||
if pressed:
|
||||
$"..".buttonReleased.emit()
|
||||
$"..".buttonUpdated.emit()
|
||||
Animator.play_backwards("interact")
|
||||
ButtonMaterial.albedo_color = baseColor
|
||||
pressed=false
|
||||
1
AGUI.Scripts/AGUI.IconButton3D.Collider.gd.uid
Normal file
1
AGUI.Scripts/AGUI.IconButton3D.Collider.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://crq0dvryyehig
|
||||
15
AGUI.Scripts/AGUI.IconButton3D.gd
Normal file
15
AGUI.Scripts/AGUI.IconButton3D.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
@tool
|
||||
extends Node3D
|
||||
|
||||
signal buttonPressed
|
||||
signal buttonReleased
|
||||
signal buttonUpdated
|
||||
|
||||
@export_category("Visuals")
|
||||
@export var baseColor : Color
|
||||
@export var pressedColor : Color
|
||||
@export var icon : Texture2D
|
||||
|
||||
func _ready() -> void:
|
||||
$StaticBody3D._initButton(baseColor,pressedColor,icon)
|
||||
print(baseColor,pressedColor)
|
||||
1
AGUI.Scripts/AGUI.IconButton3D.gd.uid
Normal file
1
AGUI.Scripts/AGUI.IconButton3D.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dkmw6hfq1nkrk
|
||||
37
AGUI.Scripts/AGUI.ToggleCharacterButton3D.Collider.gd
Normal file
37
AGUI.Scripts/AGUI.ToggleCharacterButton3D.Collider.gd
Normal file
@@ -0,0 +1,37 @@
|
||||
extends StaticBody3D
|
||||
|
||||
var baseColor : Color
|
||||
var pressedColor : Color
|
||||
@onready var Animator = $Animator
|
||||
var pressed : bool = false
|
||||
var ButtonMaterial : StandardMaterial3D = StandardMaterial3D.new()
|
||||
var isBeingHeld = false
|
||||
|
||||
func _initButton(BaseColor:Color,PressedColor:Color,char:String):
|
||||
baseColor=BaseColor
|
||||
pressedColor=PressedColor
|
||||
ButtonMaterial.albedo_color = BaseColor
|
||||
$Label3D.text = char
|
||||
|
||||
func _ready() -> void:
|
||||
$MeshRoot.material_override = ButtonMaterial
|
||||
ButtonMaterial.albedo_color = baseColor
|
||||
Animator.get_animation("interact").loop_mode = Animation.LOOP_NONE
|
||||
|
||||
func press():
|
||||
if !pressed:
|
||||
$"..".buttonPressed.emit($Label3D.text)
|
||||
$"..".buttonUpdated.emit()
|
||||
Animator.play("interact")
|
||||
ButtonMaterial.albedo_color = pressedColor
|
||||
pressed = true
|
||||
else:
|
||||
$"..".buttonReleased.emit()
|
||||
$"..".buttonUpdated.emit()
|
||||
Animator.play_backwards("interact")
|
||||
ButtonMaterial.albedo_color = baseColor
|
||||
pressed = false
|
||||
|
||||
|
||||
func release():
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
uid://dfdsr0t25d4ha
|
||||
17
AGUI.Scripts/AGUI.ToggleCharacterButton3D.gd
Normal file
17
AGUI.Scripts/AGUI.ToggleCharacterButton3D.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
@tool
|
||||
extends Node3D
|
||||
|
||||
signal buttonPressed(char)
|
||||
signal buttonReleased
|
||||
signal buttonUpdated
|
||||
|
||||
@export_category("Visuals")
|
||||
@export var baseColor : Color
|
||||
@export var pressedColor : Color
|
||||
@export var char : String
|
||||
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
$StaticBody3D._initButton(baseColor,pressedColor,char)
|
||||
print(baseColor,pressedColor)
|
||||
1
AGUI.Scripts/AGUI.ToggleCharacterButton3D.gd.uid
Normal file
1
AGUI.Scripts/AGUI.ToggleCharacterButton3D.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d0up8mkp431mn
|
||||
69
AGUI.ToggleCharacterButton3D.tscn
Normal file
69
AGUI.ToggleCharacterButton3D.tscn
Normal file
@@ -0,0 +1,69 @@
|
||||
[gd_scene format=3 uid="uid://bigr5fyb4o6pr"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d0up8mkp431mn" path="res://AgainstGravityUI/AGUI.Scripts/AGUI.ToggleCharacterButton3D.gd" id="1_i1u37"]
|
||||
[ext_resource type="Script" uid="uid://dfdsr0t25d4ha" path="res://AgainstGravityUI/AGUI.Scripts/AGUI.ToggleCharacterButton3D.Collider.gd" id="2_i1u37"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_xeeyd"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_1du0n"]
|
||||
length = 0.001
|
||||
tracks/0/type = "position_3d"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("StaticBody3D/MeshRoot")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_xjbij"]
|
||||
resource_name = "interact"
|
||||
length = 0.1
|
||||
tracks/0/type = "position_3d"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("StaticBody3D/MeshRoot")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0, 0.03333334, 1, 0, -0.05, 0)
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_7pntp"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_1du0n"),
|
||||
&"interact": SubResource("Animation_xjbij")
|
||||
}
|
||||
|
||||
[node name="AGUIIconButton3D" type="Node3D" unique_id=81597797]
|
||||
script = ExtResource("1_i1u37")
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=1473098479]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
script = ExtResource("2_i1u37")
|
||||
|
||||
[node name="Collider" type="CollisionShape3D" parent="StaticBody3D" unique_id=335334790]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.011110017, 0, 0, 0, 1, 0, 0, 0)
|
||||
shape = SubResource("BoxShape3D_xeeyd")
|
||||
|
||||
[node name="MeshRoot" type="CSGCombiner3D" parent="StaticBody3D" unique_id=1112723183]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.024529457, 0, 0, 0, 1, 0, 0, 0)
|
||||
operation = 2
|
||||
|
||||
[node name="MainMesh" type="CSGBox3D" parent="StaticBody3D/MeshRoot" unique_id=1438018078]
|
||||
|
||||
[node name="Subtractor_Box" type="CSGBox3D" parent="StaticBody3D/MeshRoot/MainMesh" unique_id=842962794]
|
||||
operation = 2
|
||||
|
||||
[node name="Subtractor_Cylinder" type="CSGCylinder3D" parent="StaticBody3D/MeshRoot/MainMesh/Subtractor_Box" unique_id=1951089581]
|
||||
transform = Transform3D(0.9, 0, 0, 0, 0.9, 0, 0, 0, 0.9, 0, 0, 0)
|
||||
operation = 2
|
||||
radius = 0.734
|
||||
|
||||
[node name="Animator" type="AnimationPlayer" parent="StaticBody3D" unique_id=53081295]
|
||||
root_node = NodePath("../..")
|
||||
libraries/ = SubResource("AnimationLibrary_7pntp")
|
||||
|
||||
[node name="Label3D" type="Label3D" parent="StaticBody3D" unique_id=1429557569]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 0.024055064, 0)
|
||||
text = "?"
|
||||
font_size = 128
|
||||
outline_size = 0
|
||||
Reference in New Issue
Block a user