Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noahgwood/ezimgui
Easy to use ImGui framework for .Net
https://github.com/noahgwood/ezimgui
Last synced: 7 days ago
JSON representation
Easy to use ImGui framework for .Net
- Host: GitHub
- URL: https://github.com/noahgwood/ezimgui
- Owner: NoahGWood
- License: mit
- Created: 2023-11-26T19:58:20.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-11-29T11:21:25.000Z (12 months ago)
- Last Synced: 2024-10-30T00:36:32.324Z (17 days ago)
- Language: C#
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EZImGui
Easy to use ImGui framework for .Net## How To Use
Creating Panels/Menus
```
using ImGuiNet;public class MyPanel : IPanel
{
public void Render()
{
ImGui.ShowDemoWindow();
}
}public class MyMenu : IMenu
{
public void RenderMenu()
{
if(ImGui.BeginMenu("File"))
{
if(ImGui.MenuItem("Some Item"))
Logger.Debug("Some Item Clicked!");
ImGui.EndMenu();
}
}
}```
Setup your app
```
using EZImGui;
using ImGuiNet;static class Program
{
static void Main(string[] args)
{
// Create App
App.CreateApp("My App Name", 800, 480);
// Add Menus
App.AddMenu(new MyMenu());
// Add Panels
App.AddPanel(new MyPanel());
// Start the app
App.Run();
}
}```
# Settings (In Development)
The framework includes a YAML based settings framework. If settings are enabled, they will be automatically loaded/saved on app start/end.
To implement your own settings, simply create a new class defining your settings, create a new AppSettings with your class
```
class MySettings
{
public string SomeVar { get; set; }
...
}```
Then in your main program:
```
AppSettings settings = new AppSettings();
```
Add any type converters (optional)
```
settings.AddTypeConverter(new MyTypeConverter());
```
Register your settings handler
settings. (optional)
```
settings.HandleSettings = SettingsHandler;
```
Finally, add the settings class to your app:
```
App.AddSettings(settings);
```You generally shouldn't need to add a SettingsHandler, but it may be useful for some special cases. Otherwise, you should be able to access your settings by calling the App.Settings.GetSettings() function, or by casting the App.Settings interface back to your type.
# Contributing
All contributions are welcome!