diff --git a/.gitignore b/.gitignore index 8aad82d..5923168 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .import/ .mono/ .vs/ +.vscode/ *.old imgui.ini .godot/ diff --git a/src/MySecondNode.cs b/src/MySecondNode.cs index 8e51b81..42d290d 100644 --- a/src/MySecondNode.cs +++ b/src/MySecondNode.cs @@ -12,6 +12,7 @@ public partial class MySecondNode : Node private float scale; private ImFontPtr proggy; private ColorRect background; + private int numClicks = 0; private static bool fontLoaded = false; private static System.Numerics.Vector4 myTextColor = Colors.Aquamarine.ToVector4(); @@ -94,6 +95,15 @@ private void OnImGuiLayout() Widgets.Image(iconTexture, new(iconSize, iconSize)); ImGui.DragInt("size", ref iconSize, 1.0f, 32, 512); + ImGui.Separator(); + ImGui.Text("ImageButton"); + if (Widgets.ImageButton("myimgbtn", iconTexture, new(128, 128))) + { + ++numClicks; + } + ImGui.SameLine(); + ImGui.Text($"{numClicks}"); + ImGui.Separator(); ImGui.Text("Unicode"); ImGui.Text("Hiragana: こんばんは");