-
Notifications
You must be signed in to change notification settings - Fork 1
Quickstart
realonepiecefreak edited this page Sep 29, 2024
·
2 revisions
Create a form class, with which the application should start with. It has to derive from Form
.
Use its constructor to set up the various properties, like Content
, Size
, Title
, Icon
, and more.
class MainForm : Form
{
public MainForm()
{
this.Title = "Demo App";
this.Size = new Vector2(700, 400);
// ImGui.Forms uses imageSharp for its internal operations and image buffers.
this.Icon = Image.Load<Rgba32>(@"path/to/icon");
this.Content = new Label { Text = "Demo Text" };
}
}
Create an instance of Application
and let it show your main form.
var app = new Application();
var form = new MainForm();
app.Execute(form);
Voila. You have created and started your first application with ImGui.Forms.
For all the components and how to use them, refer to Components and Layouts.
For a more in-depth look at Application
and Form
, refer to Application.