Работа в процессе. Простая кнопка
This commit is contained in:
49
scenes/button_flat.tscn
Normal file
49
scenes/button_flat.tscn
Normal file
@@ -0,0 +1,49 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://da7w3vkhadfwe"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/nine-patch-button.gd" id="1_wpbps"]
|
||||
[ext_resource type="Texture2D" uid="uid://ct0ajcwno03h7" path="res://data/кнопка-квадрат-0.png" id="2_1xr6o"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="1"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="6"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="2"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="3"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="5"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="4"]
|
||||
|
||||
[node name="container" type="PanelContainer"]
|
||||
offset_right = 30.0
|
||||
offset_bottom = 30.0
|
||||
theme_override_styles/panel = SubResource("1")
|
||||
script = ExtResource("1_wpbps")
|
||||
toggle_mode = true
|
||||
|
||||
[node name="state" type="NinePatchRect" parent="."]
|
||||
show_behind_parent = true
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_1xr6o")
|
||||
patch_margin_left = 10
|
||||
patch_margin_top = 10
|
||||
patch_margin_right = 10
|
||||
patch_margin_bottom = 10
|
||||
axis_stretch_horizontal = 1
|
||||
axis_stretch_vertical = 1
|
||||
|
||||
[node name="button" type="Button" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_styles/normal = SubResource("6")
|
||||
theme_override_styles/hover = SubResource("2")
|
||||
theme_override_styles/pressed = SubResource("3")
|
||||
theme_override_styles/disabled = SubResource("5")
|
||||
theme_override_styles/focus = SubResource("4")
|
||||
toggle_mode = true
|
||||
clip_text = true
|
||||
|
||||
[node name="label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[connection signal="toggled" from="button" to="." method="_on_button_toggled"]
|
||||
Reference in New Issue
Block a user