- 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
staticinlineanimate(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 |
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 |
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 |
|---|
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
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
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 |
|---|
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
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
staticgetAlpha(node:GuiNode):Float
- Gets the node alpha.
Parameters:
node | node from which to get alpha |
|---|
Returns:
0..1 alpha color
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
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
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
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
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
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
staticgetColor(node:GuiNode):Vector4
- Gets the node color.
Parameters:
node | node to get the color from |
|---|
Returns:
node color
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
staticgetFlipbook(node:GuiNode):Hash
- Get node flipbook animation.
Parameters:
node | node to get flipbook animation from |
|---|
Returns:
animation animation id
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
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
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
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
staticgetId(node:GuiNode):Hash
- Gets the id of the specified node.
Parameters:
node | node to retrieve the id from |
|---|
Returns:
id of the node
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
staticgetInheritAlpha(node:GuiNode):Bool
- Gets the node inherit alpha state.
Parameters:
node | node from which to get the inherit alpha state |
|---|
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
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
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.
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)
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
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 |
|---|
staticgetNode(id:HashOrString):GuiNode
- Gets the node with the specified id.
Parameters:
id | id of the node to retrieve |
|---|
Returns:
node instance
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
staticgetOutline(node:GuiNode):Vector4
- Gets the node outline color.
Parameters:
node | node to get the outline color from |
|---|
Returns:
node outline color
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
staticgetParticlefx(node:GuiNode):Hash
- Get the paricle fx for a gui node
Parameters:
node | node to get particle fx for |
|---|
Returns:
particle fx id
staticgetPerimeterVertices():Int
- Gets the number of generated vertices around the perimeter.
Returns:
vertex count
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
staticgetPosition(node:GuiNode):Vector3
- Gets the node position.
Parameters:
node | node to get the position from |
|---|
Returns:
node position
staticgetRotation(node:GuiNode):Vector3
- Gets the node rotation.
Parameters:
node | node to get the rotation from |
|---|
Returns:
node rotation
staticgetScale(node:GuiNode):Vector3
- Gets the node scale.
Parameters:
node | node to get the scale from |
|---|
Returns:
node scale
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
staticgetShadow(node:GuiNode):Vector4
- Gets the node shadow color.
Parameters:
node | node to get the shadow color from |
|---|
Returns:
node shadow color
staticgetSize(node:GuiNode):Vector3
- Gets the node size.
Parameters:
node | node to get the size from |
|---|
Returns:
node size
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
staticgetSlice9(node:GuiNode):Vector4
- Get the slice9 values for the node.
Parameters:
node | node to manipulate |
|---|
Returns:
configuration values
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
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
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)
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
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.
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
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
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 |
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 |
staticnewBoxNode(pos:EitherType<Vector3, Vector4>, size:Vector3):GuiNode
- Creates a new box node.
Parameters:
pos | node position |
|---|---|
size | node size |
Returns:
new box 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
staticnewPieNode(pos:EitherType<Vector3, Vector4>, size:Vector3):GuiNode
- Creates a new pie node.
Parameters:
pos | node position |
|---|---|
size | node size |
Returns:
new box 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
staticnewTextNode(pos:EitherType<Vector3, Vector4>, text:String):GuiNode
- Creates a new text node.
Parameters:
pos | node position |
|---|---|
text | node text |
Returns:
new text node
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
|
buffer | texture data |
flip | flip texture vertically |
Returns:
texture creation was successful
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
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 |
staticinlineplayParticlefx(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 |
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 |
staticresetKeyboard():Void
- Reset on-display keyboard if available.
Reset input context of keyboard. This will clear marked text.
staticresetMaterial(node:GuiNode):Void
- Resets the node material to the material assigned in the gui scene.
Parameters:
node | node to reset the material for |
|---|
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
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 |
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 |
staticsetAlpha(node:GuiNode, alpha:Float):Void
- Sets the node alpha.
Parameters:
node | node on which to set alpha |
|---|---|
alpha | 0..1 alpha color |
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 |
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 |
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 |
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 |
staticsetColor(node:GuiNode, color:EitherType<Vector3, Vector4>):Void
- Sets the node color.
Parameters:
node | node to set the color for |
|---|---|
color | new color |
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 |
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 |
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 |
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 |
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 |
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" } |
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 |
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 |
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 |
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 |
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
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) |
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 |
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_materialinstead.
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 |
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 |
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 |
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 |
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 |
staticsetPerimeterVertices(vertex:Int):Void
- Sets the number of generarted vertices around the perimeter.
Parameters:
vertex | count |
|---|
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 |
staticsetPosition(node:GuiNode, position:EitherType<Vector3, Vector4>):Void
- Sets the node position.
Parameters:
node | node to set the position for |
|---|---|
position | new position |
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 |
|---|
staticsetRotation(node:GuiNode, rotation:EitherType<Vector3, Vector4>):Void
- Sets the node rotation.
Parameters:
node | node to set the rotation for |
|---|---|
rotation | new rotation |
staticsetScale(node:GuiNode, scale:EitherType<Vector3, Vector4>):Void
- Sets the node scale.
Parameters:
node | node to set the scale for |
|---|---|
scale | new scale |
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 |
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 |
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
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 |
staticsetSlice9(node:GuiNode, params:Vector4):Void
- Set the slice9 configuration for the node.
Parameters:
node | node to manipulate |
|---|---|
params | new value |
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) |
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 |
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 |
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 |
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 |
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 |
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
|
buffer | texture data |
flip | flip texture vertically |
Returns:
setting the data was successful
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" } |
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) |
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 |
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 |
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 |
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 |
staticstopParticlefx(node:GuiNode):Void
- Stops the particle fx for a gui node
Parameters:
node | node to stop particle fx for |
|---|