• GUI core hooks, functions, messages, properties and constants for creation and manipulation of GUI nodes. The "gui" namespace is accessible only from gui scripts.

See GuiMessages for related messages.

Static methods

@:has_untypedstaticinlineanimate(node:GuiNode, property:EitherType<GuiAnimateProperty, String>, to:GoAnimatedProperty, easing:EitherType<GuiEasing, Vector>, duration:Float, ?delay:Float, ?completeFunction:GuiNode ‑> Void, ?playback:GuiPlayback):Void

  • Animates a node property.

This starts an animation of a node property according to the specified parameters. If the node property is already being animated, that animation will be canceled and replaced by the new one. Note however that several different node properties can be animated simultaneously. Use gui.cancel_animation to stop the animation before it has completed.

Composite properties of type vector3, vector4 or quaternion also expose their sub-components (x, y, z and w). You can address the components individually by suffixing the name with a dot '.' and the name of the component. For instance, "position.x" (the position x coordinate) or "color.w" (the color alpha value).

If a completeFunction is specified, that function will be called when the animation has completed. By starting a new animation in that function, several animations can be sequenced together. See the examples for more information.

Parameters:

node

node to animate

property

property to animate (one of PROP_* constant)

to

target property value

easing

easing to use during animation.

duration

duration of the animation in seconds.

delay

delay before the animation starts in seconds.

completeFunction

function to call when the animation has completed

playback

playback mode

@:native("cancel_animation")staticcancelAnimation(node:GuiNode, property:String):Void

  • Cancels an ongoing animation.

If an animation of the specified node is currently running (started by gui.animate), it will immediately be canceled.

Parameters:

node

node that should have its animation canceled

property

property for which the animation should be canceled

@:native("cancel_flipbook")staticcancelFlipbook(node:GuiNode):Void

  • Cancel a node flipbook animation.

Cancels any running flipbook animation on the specified node.

Parameters:

node

node cancel flipbook animation for

@:native("cancel_spine")staticcancelSpine(node:GuiNode):Void

  • Cancel a spine animation.

Parameters:

node

spine node that should cancel its animation

staticclone(node:GuiNode):GuiNode

  • Clone a node.

This does not include its children. Use Gui.clone_tree for that purpose.

Parameters:

node

node to clone

Returns:

the cloned node

@:native("clone_tree")staticcloneTree(node:GuiNode):Table<Hash, GuiNode>

  • Clone a node including its children.

Use Gui.clone to clone a node excluding its children.

Parameters:

node

root node to clone

Returns:

a table mapping node ids to the corresponding cloned nodes

@:native("delete_node")staticdeleteNode(node:GuiNode):Void

  • Deletes a node.

Deletes the specified node. Any child nodes of the specified node will be recursively deleted.

Parameters:

node

node to delete

@:native("delete_texture")staticdeleteTexture(texture:HashOrString):Void

  • Delete a dynamically created texture.

Parameters:

texture

texture id

staticget<T>(node:GuiNode, property:Property<T>, ?options:Null<AnyTable>):T

staticget(node:GuiNode, property:HashOrString, ?options:Null<AnyTable>):Dynamic

  • Gets a named property of the specified GUI node.

Properties available in the default GUI system are documented in the GuiNodeProperties class.

Parameters:

node

the gui node to get a property from

property

the property to retrieve

options

(optional) options table - index integer index into array property (1 based) - key hash name of internal property

Returns:

the value of the specified property

@:native("get_adjust_mode")staticgetAdjustMode(node:GuiNode):GuiAdjustMode

  • Gets the node adjust mode.

Adjust mode defines how the node will adjust itself to a screen resolution which differs from the project settings.

Parameters:

node

node from which to get the adjust mode

Returns:

node adjust mode

@:native("get_alpha")staticgetAlpha(node:GuiNode):Float

  • Gets the node alpha.

Parameters:

node

node from which to get alpha

Returns:

0..1 alpha color

@:native("get_xanchor")staticgetAnchorX(node:GuiNode):GuiAnchor

  • Gets the x-anchor of a node.

The x-anchor specifies how the node is moved when the game is run in a different resolution.

Parameters:

node

node to get x-anchor from

Returns:

anchor anchor constant

@:native("get_yanchor")staticgetAnchorY(node:GuiNode):GuiAnchor

  • Gets the y-anchor of a node.

The y-anchor specifies how the node is moved when the game is run in a different resolution.

Parameters:

node

node to get y-anchor from

Returns:

anchor anchor constant

@:native("get_blend_mode")staticgetBlendMode(node:GuiNode):GuiBlendMode

  • Gets the node blend mode.

Blend mode defines how the node will be blended with the background.

Parameters:

node

node from which to get the blend mode

Returns:

node blend mode

@:native("get_clipping_inverted")staticgetClippingInverted(node:GuiNode):Bool

  • Gets node clipping inverted state.

If node is set as an inverted clipping node, it will clip anything inside as opposed to outside.

Parameters:

node

node from which to get the clipping inverted state

Returns:

true or false

@:native("get_clipping_mode")staticgetClippingMode(node:GuiNode):GuiClippingMode

  • Gets the node clipping mode.

Clipping mode defines how the node will clipping it's children nodes

Parameters:

node

node from which to get the clipping mode

Returns:

node clipping mode

@:native("get_clipping_visible")staticgetClippingVisible(node:GuiNode):Bool

  • Gets node clipping visibility state.

If node is set as visible clipping node, it will be shown as well as clipping. Otherwise, it will only clip but not show visually.

Parameters:

node

node from which to get the clipping visibility state

Returns:

true or false

@:native("get_color")staticgetColor(node:GuiNode):Vector4

  • Gets the node color.

Parameters:

node

node to get the color from

Returns:

node color

@:native("get_fill_angle")staticgetFillAngle(node:GuiNode):Float

  • Gets the angle for the filled pie sector.

Parameters:

node

node from which to get the fill angle

Returns:

sector angle

@:native("get_flipbook")staticgetFlipbook(node:GuiNode):Hash

  • Get node flipbook animation.

Parameters:

node

node to get flipbook animation from

Returns:

animation animation id

@:native("get_flipbook_cursor")staticgetFlipbookCursor(node:GuiNode):Float

  • Gets the normalized cursor of the animation on a node with flipbook animation.

This is only useful nodes with flipbook animations. Gets the normalized cursor of the flipbook animation on a node.

Parameters:

node

node to get the cursor for

Returns:

cursor value

@:native("get_flipbook_playback_rate")staticgetFlipbookPlaybackRate(node:GuiNode):Float

  • Gets the playback rate of the flipbook animation on a node.

This is only useful nodes with flipbook animations. Gets the playback rate of the flipbook animation on a node.

Parameters:

node

node to set the cursor for

Returns:

playback rate

@:native("get_font")staticgetFont(node:GuiNode):Hash

  • Gets the node font.

This is only useful for text nodes. The font must be mapped to the gui scene in the gui editor.

Parameters:

node

node from which to get the font

Returns:

font id

@:native("get_font_resource")staticgetFontResource(fontName:HashOrString):Hash

  • This is only useful for text nodes. The font must be mapped to the gui scene in the gui editor.

Parameters:

fontName

font of which to get the path hash

Returns:

path hash to resource

@:native("get_height")staticgetHeight():Float

  • Gets the scene height.

Returns:

scene height

@:native("get_id")staticgetId(node:GuiNode):Hash

  • Gets the id of the specified node.

Parameters:

node

node to retrieve the id from

Returns:

id of the node

@:native("get_index")staticgetIndex(node:GuiNode):Float

  • Gets the index of the specified node.

The index defines the order in which a node appear in a GUI scene. Higher index means the node is drawn on top of lower indexed nodes.

Parameters:

node

node to retrieve the id from

Returns:

id of the node

@:native("get_inherit_alpha")staticgetInheritAlpha(node:GuiNode):Bool

  • Gets the node inherit alpha state.

Parameters:

node

node from which to get the inherit alpha state

@:native("get_inner_radius")staticgetInnerRadius(node:GuiNode):Float

  • Gets the pie inner radius (defined along the x dimension).

Parameters:

node

node from where to get the inner radius

Returns:

inner radius

@:native("get_layer")staticgetLayer(node:GuiNode):Hash

  • Gets the node layer.

The layer must be mapped to the gui scene in the gui editor.

Parameters:

node

node from which to get the layer

Returns:

layer id

@:native("get_layout")staticgetLayout():Hash

  • Gets the scene current layout.

Returns:

layout id

@:native("get_layouts")staticgetLayouts():Table<Hash, Vector>

  • Returns a table of available GUI layouts and their sizes.

The returned table maps layout id (hash) to a Vector2-like size where x,y represent the width and height for that layout.

@:native("get_leading")staticgetLeading(node:GuiNode):Float

  • Gets the leading of the text node.

Parameters:

node

node from where to get the leading

Returns:

scaling number (default=1)

@:native("get_line_break")staticgetLineBreak(node:GuiNode):Bool

  • Get line-break mode..

This is only useful for text nodes.

Parameters:

node

node from which to get the line-break for

Returns:

line_break

@:native("get_material")staticgetMaterial(node:GuiNode):MaterialResourceReference

  • Returns the material of a node. The material must be mapped to the gui scene in the gui editor.

Parameters:

node

node to get the material for

@:native("get_node")staticgetNode(id:HashOrString):GuiNode

  • Gets the node with the specified id.

Parameters:

id

id of the node to retrieve

Returns:

node instance

@:native("get_outer_bounds")staticgetOuterBounds(node:GuiNode):GuiPieBounds

  • Gets the pie outer bounds mode.

Parameters:

node

node from where to get the outer bounds mode (node)

Returns:

PIEBOUNDS_RECTANGLE or PIEBOUNDS_ELLIPSE

@:native("get_outline")staticgetOutline(node:GuiNode):Vector4

  • Gets the node outline color.

Parameters:

node

node to get the outline color from

Returns:

node outline color

@:native("get_parent")staticgetParent(node:GuiNode):Null<GuiNode>

  • Gets the parent of the specified node.

If the specified node does not have a parent, null is returned.

Parameters:

node

the node from which to retrieve its parent

Returns:

parent instance

@:native("get_particlefx")staticgetParticlefx(node:GuiNode):Hash

  • Get the paricle fx for a gui node

Parameters:

node

node to get particle fx for

Returns:

particle fx id

@:native("get_perimeter_vertices")staticgetPerimeterVertices():Int

  • Gets the number of generated vertices around the perimeter.

Returns:

vertex count

@:native("get_pivot")staticgetPivot(node:GuiNode):GuiPivot

  • Gets the pivot of a node.

The pivot specifies how the node is drawn and rotated from its position.

Parameters:

node

node to get pivot from

Returns:

pivot constant

@:native("get_position")staticgetPosition(node:GuiNode):Vector3

  • Gets the node position.

Parameters:

node

node to get the position from

Returns:

node position

@:native("get_rotation")staticgetRotation(node:GuiNode):Vector3

  • Gets the node rotation.

Parameters:

node

node to get the rotation from

Returns:

node rotation

@:native("get_scale")staticgetScale(node:GuiNode):Vector3

  • Gets the node scale.

Parameters:

node

node to get the scale from

Returns:

node scale

@:native("get_screen_position")staticgetScreenPosition(node:GuiNode):Vector3

  • Returns the screen position of the supplied node. This function returns the calculated transformed position of the node, taking into account any parent node transforms.

Parameters:

node

node to get the screen position from

Returns:

node screen position

@:native("get_shadow")staticgetShadow(node:GuiNode):Vector4

  • Gets the node shadow color.

Parameters:

node

node to get the shadow color from

Returns:

node shadow color

@:native("get_size")staticgetSize(node:GuiNode):Vector3

  • Gets the node size.

Parameters:

node

node to get the size from

Returns:

node size

@:native("get_size_mode")staticgetSizeMode(node:GuiNode):GuiSizeMode

  • Gets the node size mode.

Size mode defines how the node will adjust itself in size according to mode.

Parameters:

node

node from which to get the size mode

Returns:

node size mode

@:native("get_slice9")staticgetSlice9(node:GuiNode):Vector4

  • Get the slice9 values for the node.

Parameters:

node

node to manipulate

Returns:

configuration values

@:native("get_text")staticgetText(node:GuiNode):String

  • Gets the node text.

This is only useful for text nodes.

Parameters:

node

node from which to get the text

Returns:

text value

@:native("get_texture")staticgetTexture(node:GuiNode):Hash

  • Gets the node texture.

This is currently only useful for box or pie nodes. The texture must be mapped to the gui scene in the gui editor.

Parameters:

node

node to get texture from

Returns:

texture id

@:native("get_tracking")staticgetTracking(node:GuiNode):Float

  • Gets the tracking of the text node.

Parameters:

node

node from where to get the tracking

Returns:

scaling number (default=0)

@:native("get_tree")staticgetTree(node:GuiNode):Table<Hash, GuiNode>

  • Get a node and all its children as a Lua table.

Parameters:

node

root node to get node tree from

Returns:

a table mapping node ids to the corresponding nodes

@:native("get_type")staticgetType(node:GuiNode):GuiNodeTypeResult

  • Get a node type at runtime.

Returns a node type constant and an optional subtype hash if the node uses a custom type.

@:native("get_visible")staticgetVisible(node:GuiNode):Bool

  • Returns true if a node is visible and false if it's not. Invisible nodes are not rendered.

Parameters:

node

node to query

Returns:

whether the node is visible

@:native("get_width")staticgetWidth():Float

  • Gets the scene width.

Returns:

scene width

@:native("hide_keyboard")statichideKeyboard():Void

  • Hide the on-display keyboard on the device.

@:native("is_enabled")staticisEnabled(node:GuiNode):Bool

  • Retrieves if a node is enabled or not.

Disabled nodes are not rendered and animations acting on them are not evaluated.

Parameters:

node

node to query

Returns:

whether the node is enabled or not

@:native("move_above")staticmoveAbove(node:GuiNode, ref:Null<GuiNode>):Void

  • Moves the first node above the second.

Supply null as the second argument to move the first node to the top.

Parameters:

node

to move

ref

reference node above which the first node should be moved

@:native("move_below")staticmoveBelow(node:GuiNode, ref:Null<GuiNode>):Void

  • Moves the first node below the second.

Supply null as the second argument to move the first node to the bottom.

Parameters:

node

to move

ref

reference node below which the first node should be moved

@:native("new_box_node")staticnewBoxNode(pos:EitherType<Vector3, Vector4>, size:Vector3):GuiNode

  • Creates a new box node.

Parameters:

pos

node position

size

node size

Returns:

new box node

@:native("new_particlefx_node")staticnewParticlefxNode(pos:EitherType<Vector4, Vector3>, particlefx:HashOrString):GuiNode

  • Dynamically create a particle fx node.

Parameters:

pos

node position

particlefx

particle fx resource name

Returns:

new particle fx node

@:native("new_pie_node")staticnewPieNode(pos:EitherType<Vector3, Vector4>, size:Vector3):GuiNode

  • Creates a new pie node.

Parameters:

pos

node position

size

node size

Returns:

new box node

@:native("new_spine_node")staticnewSpineNode(pos:EitherType<Vector3, Vector4>, spineScene:HashOrString):GuiNode

  • Creates a new spine node.

Parameters:

pos

node position

spineScene

spine scene id

Returns:

new spine node

@:native("new_text_node")staticnewTextNode(pos:EitherType<Vector3, Vector4>, text:String):GuiNode

  • Creates a new text node.

Parameters:

pos

node position

text

node text

Returns:

new text node

@:native("new_texture")staticnewTexture(texture:HashOrString, width:Float, height:Float, type:ImageType, buffer:BufferData, ?flip:Bool):GuiNewTextureResult

  • Create new texture.

Dynamically create a new texture.

Parameters:

texture

texture id

width

texture width

height

texture height

type

texture type "rgb" - RGB "rgba" - RGBA * "l" - LUMINANCE

buffer

texture data

flip

flip texture vertically

Returns:

texture creation was successful

@:native("pick_node")staticpickNode(node:GuiNode, x:Float, y:Float):Bool

  • Determines if the node is pickable by the supplied coordinates.

Parameters:

node

node to be tested for picking

x

x-coordinate

y

y-coordinate

Returns:

pick result

@:native("play_flipbook")staticplayFlipbook(node:GuiNode, animation:HashOrString, ?completeFunction:() ‑> Void, ?playProperties:Null<GuiPlayFlipbookProperties>):Void

  • Play node flipbook animation.

Play flipbook animation on a box or pie node. The current node texture must contain the animation.

Parameters:

node

node to set animation for

animation

animation id

completeFunction

function to call when the animation has completed

playProperties

optional table with properties

@:has_untypedstaticinlineplayParticlefx(node:GuiNode, ?emitterStateFunction:(Hash, Hash, ParticlefxEmitterState) ‑> Void):Void

  • Plays the paricle fx for a gui node

Parameters:

node

node to play particle fx for

emitterStateFunction

optional callback function that will be called when an emitter attached to this particlefx changes state. callback arguments: self The current object id The id of the particle fx component emitter The id of the emitter state the new state of the emitter

@:native("play_spine_anim")staticplaySpineAnim(node:GuiNode, animationId:HashOrString, playback:GuiPlayback, ?playProperties:Null<GuiPlaySpineProperties>, ?completeFunction:() ‑> Void):Void

  • Play a spine animation.

Parameters:

node

spine node that should play the animation

animationId

id of the animation to play

playback

playback mode

playProperties

optional table with properties

completeFunction

function to call when the animation has completed

@:native("reset_keyboard")staticresetKeyboard():Void

  • Reset on-display keyboard if available.

Reset input context of keyboard. This will clear marked text.

@:native("reset_material")staticresetMaterial(node:GuiNode):Void

  • Resets the node material to the material assigned in the gui scene.

Parameters:

node

node to reset the material for

@:native("reset_nodes")staticresetNodes():Void

  • Reset all nodes to initial state.

reset only applies to static node loaded from the scene. Nodes created dynamically from script are not affected

@:native("screen_to_local")staticscreenToLocal(node:GuiNode, screenPosition:Vector3):Vector3

  • Convert the screen position to the local position of supplied node.

Parameters:

node

node used for getting local transformation matrix

screenPosition

screen position

Returns:

local position

staticset<T>(node:GuiNode, property:Property<T>, value:T, ?options:Null<AnyTable>):Void

  • Sets a named property of the specified GUI node.

Properties available in the default GUI system are documented in the GuiNodeProperties class.

Parameters:

node

the gui node to set a property on

property

the property to set

value

the value to set

options

(optional) options table - index integer index into array property (1 based) - key hash name of internal property

@:native("set_adjust_mode")staticsetAdjustMode(node:GuiNode, adjustMode:GuiAdjustMode):Void

  • Sets node adjust mode.

Adjust mode defines how the node will adjust itself to a screen resolution which differs from the project settings.

Parameters:

node

node to set adjust mode for

adjustMode

adjust mode to set

@:native("set_alpha")staticsetAlpha(node:GuiNode, alpha:Float):Void

  • Sets the node alpha.

Parameters:

node

node on which to set alpha

alpha

0..1 alpha color

@:native("set_blend_mode")staticsetBlendMode(node:GuiNode, blendMode:GuiBlendMode):Void

  • Sets node blend mode.

Blend mode defines how the node will be blended with the background.

Parameters:

node

node to set blend mode for

blendMode

blend mode to set

@:native("set_clipping_inverted")staticsetClippingInverted(node:GuiNode, visible:Bool):Void

  • Sets node clipping visibility.

If node is set as an inverted clipping node, it will clip anything inside as opposed to outside.

Parameters:

node

node to set clipping inverted state for

visible

true or false

@:native("set_clipping_mode")staticsetClippingMode(node:GuiNode, clippingMode:GuiClippingMode):Void

  • Sets node clipping mode state.

Clipping mode defines how the node will clipping it's children nodes

Parameters:

node

node to set clipping mode for

clippingMode

clipping mode to set

@:native("set_clipping_visible")staticsetClippingVisible(node:GuiNode, visible:Bool):Void

  • Sets node clipping visibility.

If node is set as an visible clipping node, it will be shown as well as clipping. Otherwise, it will only clip but not show visually.

Parameters:

node

node to set clipping visibility for

visible

true or false

@:native("set_color")staticsetColor(node:GuiNode, color:EitherType<Vector3, Vector4>):Void

  • Sets the node color.

Parameters:

node

node to set the color for

color

new color

@:native("set_enabled")staticsetEnabled(node:GuiNode, enabled:Bool):Void

  • Enables/disables a node.

Disabled nodes are not rendered and animations acting on them are not evaluated.

Parameters:

node

node to be enabled/disabled

enabled

whether the node should be enabled or not

@:native("set_fill_angle")staticsetFillAngle(node:GuiNode, angle:Float):Void

  • Sets the angle for the filled pie sector.

Parameters:

node

node to set the fill angle for

sector

angle

@:native("set_flipbook_cursor")staticsetFlipbookCursor(node:GuiNode, cursor:Float):Void

  • Sets the normalized cursor of the animation on a node with flipbook animation.

This is only useful nodes with flipbook animations. The cursor is normalized.

Parameters:

node

node to set the cursor for

cursor

cursor value

@:native("set_flipbook_playback_rate")staticsetFlipbookPlaybackRate(node:GuiNode, playback_rate:Float):Void

  • Sets the playback rate of the flipbook animation on a node.

This is only useful nodes with flipbook animations. Sets the playback rate of the flipbook animation on a node. Must be positive.

Parameters:

node

node to set the cursor for

playback_rate

playback rate

@:native("set_font")staticsetFont(node:GuiNode, font:HashOrString):Void

  • Sets the node font.

This is only useful for text nodes. The font must be mapped to the gui scene in the gui editor.

Parameters:

node

node for which to set the font

font

font id

@:native("set")staticsetFonts(url:Url, property:String, resource:HashOrString, options:Table<String, Dynamic>):Void

  • Set a GUI font resource using the GUI component URL.

This maps to gui.set() with the property set to "fonts". Use msg.url() as the first argument. Example: Gui.setFonts(msg.url(), "fonts", "/assets/title.font", lua.Table.of(["key" => "title_font"]))

Parameters:

url

the GUI component url (use msg.url())

property

must be the string "fonts"

resource

the font resource path

options

options table, e.g. { key = "my_font_name" }

@:native("set_id")staticsetId(node:GuiNode, id:HashOrString):Void

  • Sets the id of the specified node.

Nodes created with the Gui.new_*_node() functions get an empty id. This function allows you to give dynamically created nodes an id.

No checking is done on the uniqueness of supplied ids. It is up to you to make sure you use unique ids.

Parameters:

node

node to set the id for

id

id to set

@:native("set_inherit_alpha")staticsetInheritAlpha(node:GuiNode, inherit_alpha:Bool):Void

  • Sets the node inherit alpha state.

Parameters:

node

node from which to set the inherit alpha state

inherit_alpha

true or false

@:native("set_inner_radius")staticsetInnerRadius(node:GuiNode, inner:Float):Void

  • Sets the pie inner radius (defined along the x dimension).

Parameters:

node

node to set the inner radius for

inner

radius

@:native("set_layer")staticsetLayer(node:GuiNode, layer:HashOrString):Void

  • Sets the node layer.

The layer must be mapped to the gui scene in the gui editor.

Parameters:

node

node for which to set the layer

layer

layer id

@:native("set_layout")staticsetLayout(id:HashOrString):Bool

  • Sets the active GUI layout by id.

Returns true if the layout was found and activated, otherwise false. When Auto Layout Selection is disabled you can control the layout explicitly at runtime using this function.

Parameters:

id

layout id (hash or string)

Returns:

true if layout was changed

@:native("set_leading")staticsetLeading(node:GuiNode, leading:Float):Void

  • Sets the leading of the text node.

Parameters:

node

node for which to set the leading

leading

a scaling number for the line spacing (default=1)

@:native("set_line_break")staticsetLineBreak(node:GuiNode, line_break:Bool):Void

  • Set line-break mode.

This is only useful for text nodes.

Parameters:

node

node to set line-break for

line_break

true or false

@:native("set_material")staticsetMaterial(node:GuiNode, material:EitherType<MaterialResourceReference, String>):Void

  • Set the material on a node. The material must be mapped to the gui scene in the gui editor, and assigning a material is supported for all node types. To set the default material that is assigned to the gui scene node, use Gui.reset_material instead.

Parameters:

node

node to set the material for

material

the material id, either a hash reference or a name specified in the list of materials in the GUI file

@:native("set_outer_bounds")staticsetOuterBounds(node:GuiNode, bounds:GuiPieBounds):Void

  • Sets the pie outer bounds mode.

Parameters:

node

node for which to set the outer bounds mode

bounds

PIEBOUNDS_RECTANGLE or PIEBOUNDS_ELLIPSE

@:native("set_outline")staticsetOutline(node:GuiNode, color:EitherType<Vector3, Vector4>):Void

  • Sets the node outline color.

Parameters:

node

node to set the outline color for

color

new outline color

@:native("set_parent")staticsetParent(node:GuiNode, parent:GuiNode, ?keep_scene_transform:Bool):Void

  • Set the parent of the node.

Parameters:

node

node for which to set its parent

parent

parent node to set

keep_scene_transform

optional flag to make the scene position being perserved

@:native("set_particlefx")staticsetParticlefx(node:GuiNode, particlefx:HashOrString):Void

  • Set the paricle fx for a gui node

Parameters:

node

node to set particle fx for

particlefx

particle fx id

@:native("set_perimeter_vertices")staticsetPerimeterVertices(vertex:Int):Void

  • Sets the number of generarted vertices around the perimeter.

Parameters:

vertex

count

@:native("set_pivot")staticsetPivot(node:GuiNode, pivot:GuiPivot):Void

  • Sets the pivot of a node.

The pivot specifies how the node is drawn and rotated from its position.

Parameters:

node

node to set pivot for

pivot

pivot constant

@:native("set_position")staticsetPosition(node:GuiNode, position:EitherType<Vector3, Vector4>):Void

  • Sets the node position.

Parameters:

node

node to set the position for

position

new position

@:native("set_render_order")staticsetRenderOrder(order:Int):Void

  • Set the order number for the current GUI scene. The number dictates the sorting of the "gui" render predicate, in other words in which order the scene will be rendered in relation to other currently rendered GUI scenes.

The number must be in the range 0 to 15.

Parameters:

order

rendering order

@:native("set_rotation")staticsetRotation(node:GuiNode, rotation:EitherType<Vector3, Vector4>):Void

  • Sets the node rotation.

Parameters:

node

node to set the rotation for

rotation

new rotation

@:native("set_scale")staticsetScale(node:GuiNode, scale:EitherType<Vector3, Vector4>):Void

  • Sets the node scale.

Parameters:

node

node to set the scale for

scale

new scale

@:native("set_screen_position")staticsetScreenPosition(node:GuiNode, screenPosition:Vector3):Void

  • Set the screen position to the supplied node.

Parameters:

node

node to set the screen position to

screenPosition

the screen position to set

@:native("set_shadow")staticsetShadow(node:GuiNode, color:EitherType<Vector3, Vector4>):Void

  • Sets the node shadow color.

Parameters:

node

node to set the shadow color for

color

new shadow color

@:native("set_size")staticsetSize(node:GuiNode, size:EitherType<Vector3, Vector4>):Void

  • Sets the node size. NOTE! You can only set size on nodes with size mode set to SIZE_MODE_MANUAL @param node node to set the size for * @param size new size

@:native("set_size_mode")staticsetSizeMode(node:GuiNode, size_mode:GuiSizeMode):Void

  • Sets node size mode.

Size mode defines how the node will adjust itself in size according to mode.

Parameters:

node

node to set size mode for

size_mode

size mode to set

@:native("set_slice9")staticsetSlice9(node:GuiNode, params:Vector4):Void

  • Set the slice9 configuration for the node.

Parameters:

node

node to manipulate

params

new value

@:native("set_spine_cursor")staticsetSpineCursor(node:GuiNode, cursor:Float):Void

  • Sets the normalized cursor of the animation on a spine node.

This is only useful for spine nodes. The cursor is normalized.

Parameters:

node

spine node to set the cursor for (node)

cursor

cursor value (number)

@:native("set_spine_playback_rate")staticsetSpinePlaybackRate(node:GuiNode, playback_rate:Float):Void

  • Sets the playback rate of the animation on a spine node.

This is only useful for spine nodes. Sets the playback rate of the animation on a spine node. Must be positive.

Parameters:

node

spine node to set the cursor for

playback_rate

playback rate

@:native("set_spine_scene")staticsetSpineScene(node:GuiNode, spine_scene:HashOrString):Void

  • Sets the spine scene of a node.

Set the spine scene on a spine node. The spine scene must be mapped to the gui scene in the gui editor.

Parameters:

node

node to set spine scene for

spine_scene

spine scene id

@:native("set_spine_skin")staticsetSpineSkin(node:GuiNode, spine_skin:HashOrString, ?spine_slot:Null<HashOrString>):Void

  • Sets the spine skin on a spine node.

Parameters:

node

node to set the spine skin on

spine_skin

spine skin id

spine_slot

optional slot id to only change a specific slot

@:native("set_text")staticsetText(node:GuiNode, text:String):Void

  • Sets the node text.

This is only useful for text nodes.

Parameters:

node

node to set text for

text

text to set

@:native("set_texture")staticsetTexture(node:GuiNode, texture:HashOrString):Void

  • Sets the node texture.

Set the texture on a box or pie node. The texture must be mapped to the gui scene in the gui editor.

Parameters:

node

node to set texture for

texture

texture id

@:native("set_texture_data")staticsetTextureData(texture:HashOrString, width:Float, height:Float, type:ImageType, buffer:BufferData, ?flip:Bool):Bool

  • Set the buffer data for a texture.

Set the texture buffer data for a dynamically created texture.

Parameters:

texture

texture id

width

texture width

height

texture height

type

texture type "rgb" - RGB "rgba" - RGBA * "l" - LUMINANCE

buffer

texture data

flip

flip texture vertically

Returns:

setting the data was successful

@:native("set")staticsetTextures(url:Url, property:String, resource:HashOrString, options:Table<String, Dynamic>):Void

  • Set a GUI texture resource using the GUI component URL.

This maps to gui.set() with the property set to "textures". Use msg.url() as the first argument. Example: Gui.setTextures(msg.url(), "textures", "/assets/logo.texturec", lua.Table.of(["key" => "logo_tex"]))

Parameters:

url

the GUI component url (use msg.url())

property

must be the string "textures"

resource

the texture resource path

options

options table, e.g. { key = "my_texture" }

@:native("set_tracking")staticsetTracking(node:GuiNode, tracking:Float):Void

  • Sets the tracking of the text node.

Parameters:

node

node for which to set the tracking

tracking

a scaling number for the letter spacing (default=0)

@:native("set_visible")staticsetVisible(node:GuiNode, visible:Bool):Void

  • Set if a node should be visible or not. Only visible nodes are rendered.

Parameters:

node

node to be visible or no

visible

whether the node should be visible or not

@:native("set_xanchor")staticsetXanchor(node:GuiNode, anchor:GuiAnchor):Void

  • Sets the x-anchor of a node.

The x-anchor specifies how the node is moved when the game is run in a different resolution.

Parameters:

node

node to set x-anchor for

anchor

anchor constant

@:native("set_yanchor")staticsetYanchor(node:GuiNode, anchor:GuiAnchor):Void

  • Sets the y-anchor of a node.

The y-anchor specifies how the node is moved when the game is run in a different resolution.

Parameters:

node

node to set y-anchor for

anchor

anchor constant

@:native("show_keyboard")staticshowKeyboard(type:GuiKeyboardType, autoclose:Bool):Void

  • Shows the on-display keyboard if available.

The specified type of keyboard is displayed, if it is available on the device.

This function is only available on iOS and Android.

Parameters:

type

keyboard type

autoclose

close keyboard automatically when clicking outside

@:native("stop_particlefx")staticstopParticlefx(node:GuiNode):Void

  • Stops the particle fx for a gui node

Parameters:

node

node to stop particle fx for