Libraries

s&box libraries

XGUI-3

xenthio.xgui-3

No summary provided.

About

XGUI-3 is a new version of XGUI that cleans up and expands on XGUI-2.
It's most notable feature is the addition of an ImGui style immediate mode UI API, which makes debugging UI and development panels quick and easy to implement.

In order to use it, you must place one of these in the scene

Then after that, you can call the ImXGUI.Begin functions and stuff to draw immediate mode windows in any component anywhere in update or fixedupdate. Here's an example to get you started, The API will aim to match ImGui

private bool showWindow = true;
private bool checkboxValue = false;
private float floatValue = 0.5f;
private Color colour = Color.White;
protected override void OnUpdate()
{
// Create a window
if ( ImXGUI.Begin( "ImXGUI Window", ref showWindow ) )
{
ImXGUI.Text( "Welcome to ImXGUI!" );

if ( ImXGUI.Button( $"Click Me! ({clickCount} Clicks)" ) )
{
Log.Info( "Button clicked!" );
}

if ( ImXGUI.Checkbox( "Toggle Option", ref checkboxValue ) )
{
Log.Info( $"Checkbox changed to: {checkboxValue}" );
}

ImXGUI.SliderFloat( "Float Slider", ref floatValue, 0.0f, 1.0f, 0.025f );

ImXGUI.ColorPicker( "Colour", ref colour );

ImXGUI.End();
}
}Or you can use the razor based GUI by creating a panel that derives from window, and adding it to the XGUIRootPanel like so
Scene.GetSystem<XGUISystem>().Panel.AddChild<MyCoolWindow>();

Media

More by Xenthio

01
XMovement thumbnail
XMovement xenthio.xmovement

No summary provided.

+0 24h
13favorites
13upvotes
77%Wilson score
02
XGUI-2 thumbnail
XGUI-2 xenthio.xgui

XGUI Legacy

+0 24h
1favorites
2upvotes
34%Wilson score