From 48a26128f175047528fcc1c96590f1a7bbc281eb Mon Sep 17 00:00:00 2001 From: dam Date: Thu, 17 Feb 2022 00:30:16 +0000 Subject: Prototype with custom option set control. --- option_set/option_set.gd | 15 +++++++++++++++ option_set/option_set.tscn | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 option_set/option_set.gd create mode 100644 option_set/option_set.tscn (limited to 'option_set') 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 +} -- cgit v1.2.3