Hello ImGui,
Hello ImGui is an immediate mode GUI library inspired by IMGUI of Unity3D and dear imgui.
(outdated and to be updated) Now it runs on Win10 x64, Ubuntu 16.04, and Android. See platforms. MAC and iphone are not supported because I don't have them.
At present, ImGui lacks usability but will be improved gradually.
Get Started
For Windows and Linux
-
Preparation
- Download msjh.ttf to directory
ImGui\src\ImGui\assets\fonts
. See font note.
- Download msjh.ttf to directory
-
Create a .NET Standard 2.1 compatible project and reference ImGui.
-
Add follwing code files to your project,
Program.cs
namespace YourApp { class Program { [STAThread] static void Main() { Application.Init(); Application.Run(new MainForm()); } } }
MainForm.cs
namespace YourApp { public class MainForm : Form { public MainForm() : base(new Rect(320, 180, 1280, 720)) { } protected override void OnGUI() { //your GUI code here GUILayout.Label("Hello, ImGui!"); } } }
-
Build your project
-
Run
-
run in VS2017: Press F5
-
run in Windows console:
cd MyImGuiApp dotnet MyApp.dll
-
run in Linux terminal:
cd MyApp/bin/Debug/netcoreapp3.0 dotnet MyApp.dll
-
-
Exit
Press Esc or click the close button of the window.
For Android
(outdated and to be updated)
- Copy Android Templates project. The referenced Demo can be removed if you don't need that.
- Add your GUI code in
MainForm.OnGUI
. - Build and deploy it to your Android device.
For now, please refer to the shared project Demo for how to use Hello ImGui.
Target
A Real Universal GUI Framework.
Dependency
- ImageSharp: A cross-platform library for the processing of image files; written in C#. It provides image loading functions for ImGui.
- Xamarin.Android: Xamarin.Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#. It mainly provides C# runtime for ImGui.
Credits
DroidSans.ttf, Droid Sans is a humanist sans serif typeface designed by Steve Matteson licensed under Apache 2.
ImGui doesn't depend on following projects, some code used by ImGui are taken from them.
- Typography: C# Font Reader (TrueType / OpenType / OpenFont) , Glyphs Layout and Rendering
- OpenTK: low-level C# wrapper for OpenGL
- CSharpGL: Object Oriented OpenGL in C#
License
Hello ImGui is licensed under the LGPL License, see LICENSE for more information.