Added icon button

This commit is contained in:
Thorsten Sommer 2023-12-08 19:38:57 +01:00
parent 9f910f5d49
commit 144267dc9e
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,9 @@
using Godot;
using System;
public partial class btn_icon : Control
{
[Export(PropertyHint.TypeString, "The text to display on the button.")]
[ExportGroup("Data")]
public string Text { get; set; } = string.Empty;
}

View File

@ -0,0 +1,22 @@
[gd_scene load_steps=2 format=3 uid="uid://d0x0yv7nevod7"]
[ext_resource type="Script" path="res://scenes/btn_icon.cs" id="1_7lwon"]
[node name="btn_icon" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_7lwon")
[node name="margin" type="MarginContainer" parent="."]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="btn" type="Button" parent="margin"]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/h_separation = 6