UI.WindowBegin

static void WindowBegin(string text, Pose& pose, Vec2 size, UIWin windowType, UIMove moveType)

Begins a new window! This will push a pose onto the transform stack, and all UI elements will be relative to that new pose. The pose is actually the top-center of the window. Must be finished with a call to UI.WindowEnd().

   
string text Text to display on the window title and id for tracking element state. MUST be unique within current hierarchy.
Pose& pose The pose state for the window! If showHeader is true, the user will be able to grab this header and move it around.
Vec2 size Physical size of the window! If either dimension is 0, then the size on that axis will be auto- calculated based on the content provided during the previous frame.
UIWin windowType Describes how the window should be drawn, use a header, a body, neither, or both?
UIMove moveType Describes how the window will move when dragged around.
static void WindowBegin(string text, Pose& pose, UIWin windowType, UIMove moveType)

Begins a new window! This will push a pose onto the transform stack, and all UI elements will be relative to that new pose. The pose is actually the top-center of the window. Must be finished with a call to UI.WindowEnd(). This override omits the size value, so the size will be auto-calculated based on the content provided during the previous frame.

   
string text Text to display on the window title and id for tracking element state. MUST be unique within current hierarchy.
Pose& pose The pose state for the window! If showHeader is true, the user will be able to grab this header and move it around.
UIWin windowType Describes how the window should be drawn, use a header, a body, neither, or both?
UIMove moveType Describes how the window will move when dragged around.

Examples

A simple button

A window with a button

This is a complete window with a simple button on it! UI.Button returns true only for the very first frame the button is pressed, so using the if(UI.Button()) pattern works very well for executing code on button press!

Pose windowPoseButton = new Pose(0, 0, 0, Quat.Identity);
void ShowWindowButton()
{
	UI.WindowBegin("Window Button", ref windowPoseButton);

	if (UI.Button("Press me!"))
		Log.Info("Button was pressed.");

	UI.WindowEnd();
}




Found an issue with these docs, or have some additional questions? Create an Issue on Github!