Skip to content

2. Building your "Form" interface

Mark Palnau edited this page Jul 13, 2018 · 9 revisions

Lets get into the meat and potatoes of putting together the list of controls you want to display using GMUI!

First things first, you may want to change some settings for your GMUI interface instance. See 2a.-GMUI-Instance-Settings for more information on how to do that. This is optional.

Setting up Layers and Groups

Now, we can set up the groups that we may use or settings that we may want to adjust before creating our controls.

// Creating layers: The default is 0 and has already been created for you
GMUI_AddLayer(1,0,0); // Create a new layer # 1 at 0,0
// Create groups or controls here for layer 1
GMUI_SetOnLayer(0); // Change the layer back to 0 (only existing layers work)
// Create more on layer 0 again
// Creating a group (on a layer):
GMUI_CreateGroup(1,      10,10,   GMUIAnchor.TopRight); // Create group 1 at 10,10 anchored to top-right
// Group options:
GMUI_GroupSetSize(1,     8,6); // Set the default size to 8x6 cells
GMUI_GroupSetStyle(1, c_black, .2, c_black, .3, 0); // Add styling to draw for the group
// Overflow settings coming soon

Creating controls

// After the group is created, you can add controls to any existing group
// (see next section on creating controls)
with (GMUI_Add("MyNewControl",GMUIControl.TextString, 1,0,    6,2,   GMUIAnchor.TopLeft)) {
    GMUI_ControlAddToGroup(1);
}

Other optional settings:

// If you want to enable keyboard navigation of the controls, you can call this
GMUI_GridSetNavigation(GMUIDirection.Vertical,vk_up,vk_down,vk_left,vk_right,true);

Now to create our controls:

Code examples will go here

See the Full List of Commands here: 3.-List-of-Commands

Next, we can manipulate the controls and read values

Clone this wiki locally