Containers - Grisgram/gml-raptor GitHub Wiki

You are here:

Base Controls - โœ”Containers - Tooltips - Clickables - Checkables - ListBox - InputBox - Mouse Cursor - ControlTree


Container Controls

This is a new control type since version 3.0 and is the base control for Window and Panel, where each of them has additional children, like MessageBoxWindow and the UiRootPanel.

They only add three additional variable definitions to the Base Controls:

image

control_tree This expression defines the ControlTree for the new UI Subsystem from release 3.0.
maximize_on_create Set this to true to have the control align itself to the maximum size,
either of the gui size (if draw_on_gui is true), or the view size
container_is_touchable By default, containers are "transparent" for the mouse, they don't receive mouse_enter/leave events. Set this to true, to change this.

The Panel Object

This is a lightweight invisible object, that acts "just as a container". It does nothing by itself, except that it provides its own ControlTree, so you can add controls to it.

The ScrollPanel Object

This is a very powerful container, as it allows you to freely scroll its contents. It offers many options for drag support, wheel support and even scrollbars.

Its best used for world maps, mini maps or any other scrolling content, like the normally quite long texts of class descriptions in fantasy games.

image

horizontal_scrollbar
vertical_scrollbar
Show/Hide the scrollbars.
drag_xoffset
drag_yoffset
Set the initial "drag" position. Use this to center the view or for any situation, where "top left corner" is not the ideal starting position of the content.
mouse_drag_mode The enum offers: .none, .left, .middle and .right
Hold and drag with the specified button to freely pan the content.
mouse_drag_inverted Like the "Invert Y-Axis" option, you might know from some games. Inverts the X and Y movement when dragging with the mouse.
mouse_drag_multiplier Sometimes you might want to show some really huge thing as scrollable content. By default, dragging is translated 1:1 from your mouse movement to the drag position (you move the mouse 100 pixels, and so does the content).
However, if your content is really huge, you might want to have this movement a bit faster. This value is the multiplier for the translation from your mouse movement to the drag distance.
wheel_scroll_lines Named identically to the other controls with mouse-support, this values sets "how much" vertical scroll happens, when you use the mouse wheel. The default 3 Lines are roughly like 36 pixels (3 lines รก 12px font size, which is the default).

The Window Object

This control allows you to create your game's UI windows, be it the Settings, Statistics or any other kind of detail window in a strategy game, whatever you can imagine. Create your layout by adding controls to the ControlTree of the window.

To configure the look & feel of the window, it offers these variable definitions:

image

center_on_open If true, the window will center itself, depending on the value of draw_on_gui,
either in the center of the UI layer (draw_on_gui = true),
or in the center of the room (draw_on_gui = false)
title The title text. Supports LG Localization like all other caption properties
title_color Render color of the title text
title_color_mouse_over Render color of the title text when the mouse hovers over the title bar of the window
title_xoffset
title_yoffset
Depending on your window sprite, it may be necessary to offset the text a bit, because the nine-slice will most likely affect only the client area of the window, but not the title bar
titlebar_height The height of the titlebar-part of your window-sprite
scribble_title_align The same alignment settings like in a text align property
focus_border_color You may specify a different blend color for the window frame when it has focus
window_x_button_visible If true, a button of type window_x_button_object will be shown in the top right corner of the window
window_x_button_object The object type to use as x-button
on_opening
on_closing
callbacks to be invoked when the window opens/closes
window_is_movable
window_is_sizable
Allow the window to be moved and/or resized
window_resize_border_width The width of the border (from the sprite's edges) on all four sides that shall be interpreted as the "sizing border". When the mouse is in the sizing area, the Mouse Cursor will change to a sizing symbol based on the corner or side that is touched by the mouse

You are here:

Base Controls - โœ”Containers - Tooltips - Clickables - Checkables - ListBox - InputBox - Mouse Cursor - ControlTree

โš ๏ธ **GitHub.com Fallback** โš ๏ธ