From 2a0c495fa23e8a97eeec15c3cb5ebb1679c21338 Mon Sep 17 00:00:00 2001 From: zingballyhoo Date: Mon, 19 Feb 2018 16:43:34 +0000 Subject: [PATCH] Add ImGui.Progressbar --- .gitignore | 3 +++ src/ImGui.NET.SampleProgram/SampleWindow.cs | 3 +++ src/ImGui.NET/ImGui.cs | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 7297ca2..3cdaa1e 100644 --- a/.gitignore +++ b/.gitignore @@ -254,3 +254,6 @@ Session.vim # MSVC Stuff *.VC.db + +# Rider/Jetbrains IDEs +.idea \ No newline at end of file diff --git a/src/ImGui.NET.SampleProgram/SampleWindow.cs b/src/ImGui.NET.SampleProgram/SampleWindow.cs index c718cca..1fa6d1f 100644 --- a/src/ImGui.NET.SampleProgram/SampleWindow.cs +++ b/src/ImGui.NET.SampleProgram/SampleWindow.cs @@ -299,6 +299,9 @@ namespace ImGuiNET ImGui.Selectable("Just click somewhere to get rid of me."); ImGui.EndPopup(); } + + ImGui.Text("ProgressBar:"); + ImGui.ProgressBar(0.5f, new System.Numerics.Vector2(300, 20), "50%"); ImGui.EndWindow(); diff --git a/src/ImGui.NET/ImGui.cs b/src/ImGui.NET/ImGui.cs index f7c6bbd..1262cb4 100644 --- a/src/ImGui.NET/ImGui.cs +++ b/src/ImGui.NET/ImGui.cs @@ -441,6 +441,10 @@ namespace ImGuiNET return ImGuiNative.igButton(message, size); } + public static unsafe void ProgressBar(float fraction, Vector2 size, string overlayText) { + ImGuiNative.igProgressBar(fraction, &size, overlayText); + } + public static void SetNextWindowSize(Vector2 size, Condition condition) { ImGuiNative.igSetNextWindowSize(size, condition);