ktsu.ImGuiWidgets
1.0.15-pre.1
Prefix Reserved
See the version list below for details.
dotnet add package ktsu.ImGuiWidgets --version 1.0.15-pre.1
NuGet\Install-Package ktsu.ImGuiWidgets -Version 1.0.15-pre.1
<PackageReference Include="ktsu.ImGuiWidgets" Version="1.0.15-pre.1" />
paket add ktsu.ImGuiWidgets --version 1.0.15-pre.1
#r "nuget: ktsu.ImGuiWidgets, 1.0.15-pre.1"
// Install ktsu.ImGuiWidgets as a Cake Addin #addin nuget:?package=ktsu.ImGuiWidgets&version=1.0.15-pre.1&prerelease // Install ktsu.ImGuiWidgets as a Cake Tool #tool nuget:?package=ktsu.ImGuiWidgets&version=1.0.15-pre.1&prerelease
ktsu.ImGuiWidgets
ImGuiWidgets is a library of custom widgets using ImGui.NET. This library provides a variety of widgets and utilities to enhance your ImGui-based applications.
Features
- Knobs: Ported to .NET from imgui-works/imgui-knobs-dial-gauge-meter
- Resizable Layout Dividers: Draggable layout dividers for resizable layouts
- Icons: Customizable icons with various alignment options and event delegates
- Grid: Flexible grid layout for displaying items
- Color Indicator: An indicator that displays a color when enabled
- Image: An image widget with alignment options
- Text: A text widget with alignment options
- Tree: A tree widget for displaying hierarchical data
- Scoped Id: A utility class for creating scoped IDs
Installation
To install ImGuiWidgets, you can add the library to your .NET project using the following command:
dotnet add package ktsu.ImGuiWidgets
Usage
To use ImGuiWidgets, you need to include the ktsu.ImGuiWidgets
namespace in your code:
using ktsu.ImGuiWidgets;
Then, you can start using the widgets provided by ImGuiWidgets in your ImGui-based applications.
Examples
Here are some examples of using ImGuiWidgets:
Knobs
Knobs are useful for creating dial-like controls:
float value = 0.5f;
float minValue = 0.0f;
ImGuiWidgets.Knob("Knob", ref value, minValue);
Icons
Icons can be used to display images with various alignment options and event delegates:
float iconWidthEms = 7.5f;
float iconWidthPx = ImGuiApp.EmsToPx(iconWidthEms);
uint textureId = ImGuiApp.GetOrLoadTexture("icon.png");
ImGuiWidgets.Icon("Click Me", textureId, iconWidthPx, Color.White.Value, ImGuiWidgets.IconAlignment.Vertical, new ImGuiWidgets.IconDelegates()
{
OnClick = () => MessageOK.Open("Click", "You clicked")
});
ImGui.SameLine();
ImGuiWidgets.Icon("Double Click Me", textureId, iconWidthPx, Color.White.Value, ImGuiWidgets.IconAlignment.Vertical, new ImGuiWidgets.IconDelegates()
{
OnDoubleClick = () => MessageOK.Open("Double Click", "You clicked twice")
});
ImGui.SameLine();
ImGuiWidgets.Icon("Right Click Me", textureId, iconWidthPx, Color.White.Value, ImGuiWidgets.IconAlignment.Vertical, new ImGuiWidgets.IconDelegates()
{
OnContextMenu = () =>
{
ImGui.MenuItem("Context Menu Item 1");
ImGui.MenuItem("Context Menu Item 2");
ImGui.MenuItem("Context Menu Item 3");
},
});
Grid
The grid layout allows you to display items in a flexible grid:
float iconSizeEms = 7.5f;
float iconSizePx = ImGuiApp.EmsToPx(iconSizeEms);
uint textureId = ImGuiApp.GetOrLoadTexture("icon.png");
ImGuiWidgets.Grid(items, i => ImGuiWidgets.CalcIconSize(i, iconSizePx), (item, cellSize, itemSize) =>
{
ImGuiWidgets.Icon(item, textureId, iconSizePx, Color.White.Value);
});
Color Indicator
The color indicator widget displays a color when enabled:
bool enabled = true;
Color color = Color.Red;
ImGuiWidgets.ColorIndicator("Color Indicator", enabled, color);
Image
The image widget allows you to display images with alignment options:
uint textureId = ImGuiApp.GetOrLoadTexture("image.png");
ImGuiWidgets.Image(textureId, new Vector2(100, 100));
Text
The text widget allows you to display text with alignment options:
ImGuiWidgets.Text("Hello, ImGuiWidgets!");
ImGuiWidgets.TextCentered("Hello, ImGuiWidgets!");
ImGuiWidgets.TextCenteredWithin("Hello, ImGuiWidgets!", new Vector2(100, 100));
Tree
The tree widget allows you to display hierarchical data:
using (var tree = new ImGuiWidgets.Tree())
{
for (int i = 0; i < 5; i++)
{
using (tree.Child)
{
ImGui.Button($"Hello, Child {i}!");
using (var subtree = new ImGuiWidgets.Tree())
{
using (subtree.Child)
{
ImGui.Button($"Hello, Grandchild!");
}
}
}
}
}
Scoped Id
The scoped ID utility class helps in creating scoped IDs for ImGui elements and ensuring they get popped appropriatley:
using (new ImGuiWidgets.ScopedId())
{
ImGui.Button("Hello, Scoped ID!");
}
Contributing
Contributions are welcome! For feature requests, bug reports, or questions, please open an issue on the GitHub repository. If you would like to contribute code, please open a pull request with your changes.
Acknowledgements
ImGuiWidgets is inspired by the following projects:
License
ImGuiWidgets is licensed under the MIT License. See LICENSE for more information.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- ImGui.NET (>= 1.91.0.1)
- ktsu.CaseConverter (>= 1.0.27)
- ktsu.Extensions (>= 1.2.14)
- ktsu.FuzzySearch (>= 1.0.11)
- ktsu.ImGuiStyler (>= 1.0.13)
- ktsu.ScopedAction (>= 1.0.12)
- ktsu.StrongPaths (>= 1.1.49)
- Microsoft.Extensions.FileSystemGlobbing (>= 9.0.0)
-
net9.0
- ImGui.NET (>= 1.91.0.1)
- ktsu.CaseConverter (>= 1.0.27)
- ktsu.Extensions (>= 1.2.14)
- ktsu.FuzzySearch (>= 1.0.11)
- ktsu.ImGuiStyler (>= 1.0.13)
- ktsu.ScopedAction (>= 1.0.12)
- ktsu.StrongPaths (>= 1.1.49)
- Microsoft.Extensions.FileSystemGlobbing (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.4.1-pre.3 | 32 | 21 hours ago |
1.4.1-pre.2 | 54 | 15 days ago |
1.4.1-pre.1 | 58 | 17 days ago |
1.4.0 | 188 | 21 days ago |
1.3.1 | 94 | 21 days ago |
1.3.0 | 113 | 23 days ago |
1.2.2-pre.1 | 48 | a month ago |
1.2.1 | 121 | a month ago |
1.2.0 | 83 | a month ago |
1.1.5-pre.1 | 52 | a month ago |
1.1.4 | 94 | a month ago |
1.1.4-pre.1 | 46 | a month ago |
1.1.3 | 79 | a month ago |
1.1.2 | 85 | a month ago |
1.1.1 | 102 | a month ago |
1.1.1-pre.21 | 52 | a month ago |
1.1.1-pre.20 | 47 | a month ago |
1.1.1-pre.19 | 54 | a month ago |
1.1.1-pre.18 | 47 | a month ago |
1.1.1-pre.17 | 44 | a month ago |
1.1.1-pre.16 | 49 | a month ago |
1.1.1-pre.15 | 49 | a month ago |
1.1.1-pre.14 | 43 | a month ago |
1.1.1-pre.13 | 45 | a month ago |
1.1.1-pre.12 | 43 | a month ago |
1.1.1-pre.11 | 46 | a month ago |
1.1.1-pre.10 | 48 | a month ago |
1.1.1-pre.9 | 45 | a month ago |
1.1.1-pre.8 | 47 | a month ago |
1.1.1-pre.7 | 44 | 2 months ago |
1.1.1-pre.6 | 39 | 2 months ago |
1.1.1-pre.5 | 25 | 2 months ago |
1.1.1-pre.4 | 42 | 2 months ago |
1.1.1-pre.3 | 50 | 2 months ago |
1.1.1-pre.2 | 44 | 2 months ago |
1.1.1-pre.1 | 43 | 2 months ago |
1.1.0 | 225 | 2 months ago |
1.0.15 | 108 | 2 months ago |
1.0.15-pre.9 | 66 | 2 months ago |
1.0.15-pre.8 | 53 | 2 months ago |
1.0.15-pre.7 | 56 | 2 months ago |
1.0.15-pre.6 | 56 | 2 months ago |
1.0.15-pre.5 | 58 | 2 months ago |
1.0.15-pre.4 | 70 | 2 months ago |
1.0.15-pre.3 | 53 | 2 months ago |
1.0.15-pre.2 | 43 | 2 months ago |
1.0.15-pre.1 | 51 | 2 months ago |
1.0.14-pre.1 | 48 | 2 months ago |
1.0.13 | 90 | 2 months ago |
1.0.12 | 90 | 2 months ago |
1.0.11 | 92 | 2 months ago |
1.0.10 | 92 | 2 months ago |
1.0.10-pre.1 | 46 | 2 months ago |
1.0.9 | 93 | 2 months ago |
1.0.8 | 81 | 2 months ago |
1.0.7 | 93 | 2 months ago |
1.0.6 | 78 | 2 months ago |
1.0.5 | 89 | 2 months ago |
1.0.4 | 98 | 2 months ago |
1.0.3 | 96 | 2 months ago |
1.0.2 | 96 | 3 months ago |
1.0.1 | 82 | 3 months ago |
1.0.0 | 85 | 3 months ago |
1.0.0-alpha.116 | 60 | 3 months ago |
1.0.0-alpha.115 | 150 | 3 months ago |
1.0.0-alpha.114 | 75 | 3 months ago |
1.0.0-alpha.113 | 68 | 3 months ago |
1.0.0-alpha.112 | 66 | 3 months ago |
1.0.0-alpha.111 | 74 | 3 months ago |
1.0.0-alpha.110 | 72 | 3 months ago |
1.0.0-alpha.109 | 79 | 3 months ago |
1.0.0-alpha.108 | 57 | 3 months ago |
1.0.0-alpha.107 | 79 | 3 months ago |
1.0.0-alpha.106 | 80 | 3 months ago |
1.0.0-alpha.105 | 45 | 3 months ago |
1.0.0-alpha.104 | 48 | 3 months ago |
1.0.0-alpha.103 | 49 | 3 months ago |
1.0.0-alpha.102 | 56 | 3 months ago |
1.0.0-alpha.101 | 48 | 3 months ago |
1.0.0-alpha.100 | 70 | 3 months ago |
1.0.0-alpha.99 | 55 | 3 months ago |
1.0.0-alpha.98 | 55 | 3 months ago |
1.0.0-alpha.97 | 51 | 3 months ago |
1.0.0-alpha.96 | 56 | 3 months ago |
1.0.0-alpha.95 | 64 | 3 months ago |
1.0.0-alpha.94 | 70 | 3 months ago |
1.0.0-alpha.93 | 70 | 3 months ago |
1.0.0-alpha.92 | 59 | 3 months ago |
1.0.0-alpha.91 | 73 | 3 months ago |
1.0.0-alpha.90 | 72 | 3 months ago |
1.0.0-alpha.89 | 67 | 3 months ago |
1.0.0-alpha.88 | 77 | 3 months ago |
1.0.0-alpha.87 | 56 | 3 months ago |
1.0.0-alpha.86 | 54 | 4 months ago |
1.0.0-alpha.85 | 52 | 4 months ago |
1.0.0-alpha.84 | 56 | 4 months ago |
1.0.0-alpha.83 | 61 | 4 months ago |
1.0.0-alpha.82 | 58 | 4 months ago |
1.0.0-alpha.81 | 73 | 4 months ago |
1.0.0-alpha.80 | 54 | 4 months ago |
1.0.0-alpha.79 | 56 | 4 months ago |
1.0.0-alpha.78 | 52 | 4 months ago |
1.0.0-alpha.77 | 69 | 4 months ago |
1.0.0-alpha.76 | 225 | 4 months ago |
1.0.0-alpha.75 | 54 | 4 months ago |
1.0.0-alpha.74 | 127 | 4 months ago |
1.0.0-alpha.73 | 63 | 4 months ago |
1.0.0-alpha.72 | 65 | 4 months ago |
1.0.0-alpha.71 | 59 | 4 months ago |
1.0.0-alpha.70 | 84 | 4 months ago |
1.0.0-alpha.69 | 79 | 5 months ago |
1.0.0-alpha.68 | 81 | 5 months ago |
1.0.0-alpha.67 | 61 | 5 months ago |
1.0.0-alpha.66 | 61 | 5 months ago |
1.0.0-alpha.65 | 71 | 5 months ago |
1.0.0-alpha.64 | 56 | 5 months ago |
1.0.0-alpha.63 | 63 | 5 months ago |
1.0.0-alpha.62 | 69 | 5 months ago |
1.0.0-alpha.61 | 66 | 5 months ago |
1.0.0-alpha.60 | 54 | 5 months ago |
1.0.0-alpha.59 | 184 | 5 months ago |
1.0.0-alpha.58 | 119 | 5 months ago |
1.0.0-alpha.57 | 78 | 5 months ago |
1.0.0-alpha.56 | 56 | 5 months ago |
1.0.0-alpha.55 | 61 | 5 months ago |
1.0.0-alpha.54 | 63 | 5 months ago |
1.0.0-alpha.53 | 55 | 5 months ago |
1.0.0-alpha.52 | 68 | 5 months ago |
1.0.0-alpha.51 | 70 | 5 months ago |
1.0.0-alpha.50 | 76 | 5 months ago |
1.0.0-alpha.49 | 68 | 5 months ago |
1.0.0-alpha.48 | 70 | 5 months ago |
1.0.0-alpha.47 | 66 | 5 months ago |
1.0.0-alpha.46 | 57 | 5 months ago |
1.0.0-alpha.45 | 51 | 6 months ago |
1.0.0-alpha.44 | 66 | 6 months ago |
1.0.0-alpha.43 | 110 | 6 months ago |
1.0.0-alpha.42 | 59 | 6 months ago |
1.0.0-alpha.41 | 60 | 6 months ago |
1.0.0-alpha.40 | 55 | 6 months ago |
1.0.0-alpha.39 | 74 | 6 months ago |
1.0.0-alpha.38 | 91 | 6 months ago |
1.0.0-alpha.37 | 66 | 6 months ago |
##