Wiki

Clone wiki

Mono:UI / Objects / m_Button

INTRODUCED: v0.1.0
LAST UPDATED: v0.1.1

m_Button

This Object allows a Plan to be performed when clicked. It has a wide variety of Properties that can be applied to it.

Appearance

Button

Hierarchy

PARENT: m_Clickable
CHILDREN: -
PROPERTY GROUPS: "all", "button"

Events

Name Description
Create Initiates __state, __pressed, __surface_shadow.
Clean Up Cleans up __surface_shadow.
Step Operates the state machine that makes the Button function.
Draw Draws the button to the screen if necessary.

Instance Variables

Name Default Value Origin
__properties ds_map of properties with their default values. m_Clickable
__w 0 m_Clickable
__h 0 m_Clickable
__surface_main noone m_Clickable
__dirty true m_Clickable
__overlapping undefined m_Clickable
__state __mono_EClickableState.up
__pressed false
__surface_shadow noone

Properties

For a full list, see Properties.

Name Default Value Description
shape.width 0 The width of the Button's main component, or 0 to automatically determine it.
shape.height 0 The height of the Button's main component, or 0 to automatically determine it.
shape.padding.x 18 The horizontal padding of the Button's main component.
shape.padding.y 9 The vertical padding of the Button's main component.
shape.rounded 5 The radius of the corners of the Button's main component.
shape.border true Whether the Button's main component has a border.
shape.outline false Whether the Button's main component is only an outline.
shape.shadow true Whether the Button's main component has a shadow.
shape.shadow.colour $000000 The colour of the shadow if present.
shape.hidden false Whether the Button is hidden.
plan undefined The Plan to be executed when the Button is clicked.
plan.disabled false Whether the Button is disabled.
theme "mild" The Button's Theme.
label "\n" The text displayed on the Button.
label.font -1 The Font to use for the label.
label.side mono_ESide.left The side the label is on. Only applicable in case an Icon has been set.
label.align.x fa_center The horizontal text-alignment of the label.
label.align.y fa_middle The vertical text-alignment of the label.
label.offset.x 0 The offset the label should have after all other calculations have taken place.
label.offset.y 0 The offset the label should have after all other calculations have taken place.
icon noone The Icon to be displayed on the Button.

Updated