aboutsummaryrefslogtreecommitdiff
path: root/option_set
diff options
context:
space:
mode:
authordam <dam@gudinoff>2022-02-17 00:30:16 +0000
committerdam <dam@gudinoff>2022-02-17 00:30:16 +0000
commit48a26128f175047528fcc1c96590f1a7bbc281eb (patch)
tree03cebc078fd30f74da8fdce4469055d9b70b3985 /option_set
parent00825f2a5664000fa98d36922c0c329b052a724f (diff)
downloadsurgery-log-48a26128f175047528fcc1c96590f1a7bbc281eb.tar.zst
surgery-log-48a26128f175047528fcc1c96590f1a7bbc281eb.zip
Prototype with custom option set control.
Diffstat (limited to 'option_set')
-rw-r--r--option_set/option_set.gd15
-rw-r--r--option_set/option_set.tscn34
2 files changed, 49 insertions, 0 deletions
diff --git a/option_set/option_set.gd b/option_set/option_set.gd
new file mode 100644
index 0000000..e9cac3f
--- /dev/null
+++ b/option_set/option_set.gd
@@ -0,0 +1,15 @@
+extends Control
+class_name OptionSet
+
+var text: String setget set_text, get_text
+
+func set_text(var value: String):
+ input.text = value
+
+func get_text() -> String:
+ return input.text
+
+
+onready var input := get_node("input") as LineEdit
+
+
diff --git a/option_set/option_set.tscn b/option_set/option_set.tscn
new file mode 100644
index 0000000..fc2aff5
--- /dev/null
+++ b/option_set/option_set.tscn
@@ -0,0 +1,34 @@
+[gd_scene load_steps=2 format=2]
+
+[ext_resource path="res://option_set/option_set.gd" type="Script" id=1]
+
+[node name="option_set" type="Control"]
+anchor_right = 1.0
+anchor_bottom = 1.0
+script = ExtResource( 1 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="input" type="LineEdit" parent="."]
+anchor_right = 1.0
+anchor_bottom = 1.0
+margin_right = -100.0
+size_flags_horizontal = 3
+placeholder_text = "option set placeholder"
+caret_blink = true
+caret_blink_speed = 0.5
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="options" type="Button" parent="."]
+anchor_left = 1.0
+anchor_right = 1.0
+anchor_bottom = 1.0
+margin_left = -100.0
+grow_horizontal = 0
+text = "▽"
+__meta__ = {
+"_edit_use_anchors_": false
+}