Skip to Content
defold-typescript
Get startedGuidesAPILibraries
Defold

gui1 new3 changed

GUI API documentation

Functions

gui.animate(4 overloads): void

  1. <K extends keyof gui.NodeProperties | gui.Prop>(node: Opaque<"node">, property: K, to: NodePropertyAnimateTo<NodePropertyName<K>>, easing: gui.Easing | Vector, duration: number)

    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_animations to stop the animation before it has completed. Only the node properties gui.get lists can be animated; a material constant cannot. 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 complete_function (Lua function) 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 below for more information.

  2. <K extends keyof gui.NodeProperties | gui.Prop>(node: Opaque<"node">, property: K, to: NodePropertyAnimateTo<NodePropertyName<K>>, easing: gui.Easing | Vector, duration: number, delay: number, complete_function?: (self: unknown, node: Opaque<"node">) => void, playback?: gui.Playback)

    Same description as form 1.

    Parameters

    • node: Opaque<"node"> — node to animate
    • property: K — property to animate; each gui.PROP member equals its corresponding property name string
    • to: NodePropertyAnimateTo<NodePropertyName<K>> — target property value
    • easing: gui.Easing | Vector — easing to use during animation. Either specify one of the gui.EASING_* constants or provide a vector with a custom curve. See the animation guide for more information.
    • duration: number — duration of the animation in seconds.
    • delay: number — delay before the animation starts in seconds.
    • complete_function?: (self: unknown, node: Opaque<"node">) => void — function to call when the animation has completed
    • playback?: gui.Playback — playback mode
  3. (node: Opaque<"node">, property: Hash, to: number | Vector3 | Vector4 | Quaternion, easing: gui.Easing | Vector, duration: number)

    Animates a node property named by a hash, such as hash("position.y"). The engine resolves the name at run time, so the target value is not checked against the property: pass a number, a vmath.vector3, a vmath.vector4 or a vmath.quat as the named property expects.

  4. (node: Opaque<"node">, property: Hash, to: number | Vector3 | Vector4 | Quaternion, easing: gui.Easing | Vector, duration: number, delay: number, complete_function?: (self: unknown, node: Opaque<"node">) => void, playback?: gui.Playback)

    Same description as form 3.

    Parameters

    • node: Opaque<"node"> — node to animate
    • property: Hash — property to animate; each gui.PROP member equals its corresponding property name string
    • to: number | Vector3 | Vector4 | Quaternion — target property value
    • easing: gui.Easing | Vector — easing to use during animation. Either specify one of the gui.EASING_* constants or provide a vector with a custom curve. See the animation guide for more information.
    • duration: number — duration of the animation in seconds.
    • delay: number — delay before the animation starts in seconds.
    • complete_function?: (self: unknown, node: Opaque<"node">) => void — function to call when the animation has completed
    • playback?: gui.Playback — playback mode

How to start a simple color animation, where the node fades in to white during 0.5 seconds:

// How to start a simple color animation, where the node fades in to white during 0.5 seconds:
const node = gui.get_node("my_node");
gui.set_color(node, vmath.vector4(0, 0, 0, 0)); // node is fully transparent
gui.animate(node, gui.PROP_COLOR, vmath.vector4(1, 1, 1, 1), gui.EASING_INOUTQUAD, 0.5); // start animation
gui.set_color(node, vmath.vector4(0, 0, 0, 0)) -- node is fully transparent
gui.animate(node, gui.PROP_COLOR, vmath.vector4(1, 1, 1, 1), gui.EASING_INOUTQUAD, 0.5) -- start animation

How to start a sequenced animation where the node fades in to white during 0.5 seconds, stays visible for 2 seconds and then fades out:

// How to start a sequenced animation where the node fades in to white during 0.5
// seconds, stays visible for 2 seconds and then fades out:
function on_animation_done(self: unknown, node: Opaque<"node">) {
  // fade out node, but wait 2 seconds before the animation starts
  gui.animate(node, gui.PROP_COLOR, vmath.vector4(0, 0, 0, 0), gui.EASING_OUTQUAD, 0.5, 2.0);
}

export default defineGuiScript({
  init(self) {
    // fetch the node we want to animate
    const my_node = gui.get_node("my_node");
    // node is initially set to fully transparent
    gui.set_color(my_node, vmath.vector4(0, 0, 0, 0));
    // animate the node immediately and call on_animation_done when the animation has completed
    gui.animate(my_node, gui.PROP_COLOR, vmath.vector4(1, 1, 1, 1), gui.EASING_INOUTQUAD, 0.5, 0.0, on_animation_done);
  },
});
local function on_animation_done(self, node)
    -- fade out node, but wait 2 seconds before the animation starts
    gui.animate(node, gui.PROP_COLOR, vmath.vector4(0, 0, 0, 0), gui.EASING_OUTQUAD, 0.5, 2.0)
end

function init(self)
    -- fetch the node we want to animate
    local my_node = gui.get_node("my_node")
    -- node is initially set to fully transparent
    gui.set_color(my_node, vmath.vector4(0, 0, 0, 0))
    -- animate the node immediately and call on_animation_done when the animation has completed
    gui.animate(my_node, gui.PROP_COLOR, vmath.vector4(1, 1, 1, 1), gui.EASING_INOUTQUAD, 0.5, 0.0, on_animation_done)
end

How to animate a node's y position using a crazy custom easing curve:

// How to animate a node's y position using a crazy custom easing curve:
export default defineGuiScript({
  init(self) {
    const values = [
      0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
      0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
      0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
      0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
    ];
    const vec = vmath.vector(values);
    const node = gui.get_node("box");
    gui.animate(node, "position.y", 100, vec, 4.0, 0, undefined, gui.PLAYBACK_LOOP_PINGPONG);
  },
});
function init(self)
    local values = { 0, 0, 0, 0, 0, 0, 0, 0,
                     1, 1, 1, 1, 1, 1, 1, 1,
                     0, 0, 0, 0, 0, 0, 0, 0,
                     1, 1, 1, 1, 1, 1, 1, 1,
                     0, 0, 0, 0, 0, 0, 0, 0,
                     1, 1, 1, 1, 1, 1, 1, 1,
                     0, 0, 0, 0, 0, 0, 0, 0,
                     1, 1, 1, 1, 1, 1, 1, 1 }
    local vec = vmath.vector(values)
    local node = gui.get_node("box")
    gui.animate(node, "position.y", 100, vec, 4.0, 0, nil, gui.PLAYBACK_LOOP_PINGPONG)
end

gui.cancel_animations(node: Opaque<"node">, property?: keyof gui.NodeProperties | gui.Prop | Hash): void

If one or more animations of the specified node is currently running (started by gui.animate), they will immediately be canceled.

Start an animation of the position property of a node, then cancel parts of the animation:

const node = gui.get_node("my_node");
// animate to new position
const pos = vmath.vector3(100, 100, 0);
gui.animate(node, "position", pos, gui.EASING_LINEAR, 2);
// ...
// cancel animation of the x component.
gui.cancel_animations(node, "position.x");
local node = gui.get_node("my_node")
-- animate to new position
local pos = vmath.vector3(100, 100, 0)
gui.animate(node, "position", pos, go.EASING_LINEAR, 2)
...
-- cancel animation of the x component.
gui.cancel_animations(node, "position.x")

Cancels all property animations on a node in a single call:

const node = gui.get_node("my_node");
// animate to new position and scale
gui.animate(node, "position", vmath.vector3(100, 100, 0), gui.EASING_LINEAR, 5);
gui.animate(node, "scale", vmath.vector3(0.5), gui.EASING_LINEAR, 5);
// ...
// cancel positioning and scaling at once
gui.cancel_animations(node);
local node = gui.get_node("my_node")
-- animate to new position and scale
gui.animate(node, "position", vmath.vector3(100, 100, 0), go.EASING_LINEAR, 5)
gui.animate(node, "scale", vmath.vector3(0.5), go.EASING_LINEAR, 5)
...
-- cancel positioning and scaling at once
gui.cancel_animations(node)

Parameters

  • node: Opaque<"node"> — node that should have its animation canceled
  • property?: keyof gui.NodeProperties | gui.Prop | Hash — optional property for which the animation should be canceled
    • "position"
    • "rotation"
    • "euler"
    • "scale"
    • "color"
    • "outline"
    • "shadow"
    • "size"
    • "fill_angle" (pie)
    • "inner_radius" (pie)
    • "leading" (text)
    • "tracking" (text)
    • "slice9" (slice9)

gui.cancel_flipbook(node: Opaque<"node">): void

Cancels any running flipbook animation on the specified node.

const node = gui.get_node("anim_node");
gui.cancel_flipbook(node);
local node = gui.get_node("anim_node")
gui.cancel_flipbook(node)

Parameters

  • node: Opaque<"node"> — node cancel flipbook animation for

gui.clone(node: Opaque<"node">): Opaque<"node">

Make a clone instance of a node. The cloned node will be identical to the original node, except the id which is generated as the string "node" plus a sequential unsigned integer value. This function does not clone the supplied node's children nodes. Use gui.clone_tree for that purpose.

Parameters

  • node: Opaque<"node"> — node to clone

Returns

  • clone: Opaque<"node"> — the cloned node

gui.clone_tree(node: Opaque<"node"> | undefined): LuaTable<Hash, Opaque<"node">> & { get: LuaTableGetMethod<string, Opaque<"node">> }

Make a clone instance of a node and all its children. Use gui.clone to clone a node excluding its children.

Parameters

  • node: Opaque<"node"> | undefined — root node to clone, or nil to clone the whole scene; leaving the argument out raises an error

Returns

  • clones: LuaTable<Hash, Opaque<"node">> & { get: LuaTableGetMethod<string, Opaque<"node">> } — a table mapping node ids to the corresponding cloned nodes

gui.delete_node(node: Opaque<"node">): void

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

// Delete a particular node and any child nodes it might have:
const node = gui.get_node("my_node");
gui.delete_node(node);
local node = gui.get_node("my_node")
gui.delete_node(node)

Parameters

  • node: Opaque<"node"> — node to delete

gui.delete_texture(texture: string | Hash): void

Delete a dynamically created texture.

export default defineGuiScript({
  init(self) {
    // Create a texture.
    if (gui.new_texture("temp_tx", 10, 10, "rgb", "\0".repeat(10 * 10 * 3))) {
      // Do something with the texture.
      // ...

      // Delete the texture
      gui.delete_texture("temp_tx");
    }
  },
});
function init(self)
     -- Create a texture.
     if gui.new_texture("temp_tx", 10, 10, "rgb", string.rep('\0', 10 * 10 * 3)) then
         -- Do something with the texture.
         ...

         -- Delete the texture
         gui.delete_texture("temp_tx")
     end
end

Parameters

  • texture: string | Hash — texture id

gui.get(3 overloads)

  1. <K extends keyof gui.NodeProperties | gui.Prop>(node: Opaque<"node">, property: K): gui.NodeProperties[NodePropertyName<K>]

    Instead of using specific getters such as gui.get_position or gui.get_scale, you can use gui.get instead and supply the property as a string or a gui.PROP_* constant. Only these node properties are supported:

    • "position"
    • "rotation"
    • "euler"
    • "scale"
    • "color"
    • "outline"
    • "shadow"
    • "size"
    • "fill_angle" (pie)
    • "inner_radius" (pie)
    • "leading" (text)
    • "tracking" (text)
    • "slice9" (slice9)

    Each property but the four scalars (fill_angle, inner_radius, leading and tracking) also exposes its components as "<name>.x" to "<name>.w". Getting "rotation" returns a vmath.quat, another vector property a vmath.vector4, and a component or a scalar property a single number. To get a material constant, pass its name as a hash.

  2. (node: Opaque<"node">, property: Hash): number | Vector4 | Quaternion | Matrix4 | number[] | Vector4[] | Matrix4[]

    Gets a material constant of a node, or any property named by a hash. Pass the constant's name as a hash, such as hash("tint"). Reading an array constant without index returns every element in a table.

  3. (node: Opaque<"node">, property: Hash, options: gui.PropertyOptions): number | Vector4 | Quaternion | Matrix4 | number[] | Vector4[] | Matrix4[]

    Same description as form 2.

    Parameters

    • node: Opaque<"node"> — node to get the property for
    • property: Hash — the property to retrieve
    • options: gui.PropertyOptions — optional options table (only applicable for material constants)
      • index integer index into array property (1 based)
      ⚠️ index is 1-based; passed to Defold unchanged.
// Get properties on existing nodes:
const node = gui.get_node("my_box_node");
const node_position = gui.get(node, "position");
local node = gui.get_node("my_box_node")
local node_position = gui.get(node, "position")

gui.get_adjust_mode(node: Opaque<"node">): gui.Adjust

Returns the adjust mode of a node. The adjust mode defines how the node will adjust itself to screen resolutions that differs from the one in the project settings.

Parameters

  • node: Opaque<"node"> — node from which to get the adjust mode (node)

Returns

  • adjust_mode: gui.Adjust — the current adjust mode

gui.get_alpha(node: Opaque<"node">): number

gets the node alpha

Parameters

  • node: Opaque<"node"> — node from which to get alpha

Returns

  • alpha: number — alpha

gui.get_blend_mode(node: Opaque<"node">): gui.Blend

Returns the blend mode of a node. Blend mode defines how the node will be blended with the background.

Parameters

  • node: Opaque<"node"> — node from which to get the blend mode

Returns

gui.get_clipping_inverted(node: Opaque<"node">): boolean

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

Parameters

  • node: Opaque<"node"> — node from which to get the clipping inverted state

Returns

  • inverted: boolean — true or false

gui.get_clipping_mode(node: Opaque<"node">): gui.ClippingMode

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

Parameters

  • node: Opaque<"node"> — node from which to get the clipping mode

Returns

  • clipping_mode: gui.ClippingMode — clipping mode
    • gui.CLIPPING_MODE_NONE
    • gui.CLIPPING_MODE_STENCIL

gui.get_clipping_visible(node: Opaque<"node">): boolean

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: Opaque<"node"> — node from which to get the clipping visibility state

Returns

  • visible: boolean — true or false

gui.get_color(node: Opaque<"node">): Vector4

Returns the color of the supplied node. The components of the returned vector4 contains the color channel values:

Component Color value

x Red value

y Green value

z Blue value

w Alpha value

Parameters

  • node: Opaque<"node"> — node to get the color from

Returns

  • color: Vector4 — node color

gui.get_euler(node: Opaque<"node">): Vector3

Returns the rotation of the supplied node. The rotation is expressed in degree Euler angles.

Parameters

  • node: Opaque<"node"> — node to get the rotation from

Returns

  • rotation: Vector3 — node rotation

gui.get_fill_angle(node: Opaque<"node">): number

Returns the sector angle of a pie node.

Parameters

  • node: Opaque<"node"> — node from which to get the fill angle

Returns

  • angle: number — sector angle

gui.get_flipbook(node: Opaque<"node">): Hash

Get node flipbook animation.

Parameters

  • node: Opaque<"node"> — node to get flipbook animation from

Returns

  • animation: Hash — animation id

gui.get_flipbook_cursor(node: Opaque<"node">): number

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

Parameters

  • node: Opaque<"node"> — node to get the cursor for (node)

Returns

  • cursor: number — cursor value

gui.get_flipbook_playback_rate(node: Opaque<"node">): number

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

Parameters

  • node: Opaque<"node"> — node to set the cursor for

Returns

  • rate: number — playback rate

gui.get_font(node: Opaque<"node">): Hash

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

Parameters

  • node: Opaque<"node"> — node from which to get the font

Returns

  • font: Hash — font id

gui.get_font_resource(font_name: Hash | string): Hash

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

// Get the text metrics for a text
export default defineGuiScript({
  init(self) {
    const node = gui.get_node("name");
    const font_name = gui.get_font(node);
    const font = gui.get_font_resource(font_name);
    const metrics = resource.get_text_metrics(font, "The quick brown fox\n jumps over the lazy dog");
  },
});
function init(self)
  local node = gui.get_node("name")
  local font_name = gui.get_font(node)
  local font = gui.get_font_resource(font_name)
  local metrics = resource.get_text_metrics(font, "The quick brown fox\n jumps over the lazy dog")
end

Parameters

  • font_name: Hash | string — font of which to get the path hash

Returns

  • hash: Hash — path hash to resource

gui.get_height(): number

Returns the scene height.

Returns

  • height: number — scene height

gui.get_id(node: Opaque<"node">): Hash

Retrieves the id of the specified node.

// Gets the id of a node:
const node = gui.get_node("my_node");

const id = gui.get_id(node);
print(id); // => hash: [my_node]
local node = gui.get_node("my_node")

local id = gui.get_id(node)
print(id) --> hash: [my_node]

Parameters

  • node: Opaque<"node"> — the node to retrieve the id from

Returns

  • id: Hash — the id of the node

gui.get_index(node: Opaque<"node">): number

Retrieve the index of the specified node among its siblings. 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.

// Compare the index order of two sibling nodes:
const node1 = gui.get_node("my_node_1");
const node2 = gui.get_node("my_node_2");

if (gui.get_index(node1) < gui.get_index(node2)) {
  // node1 is drawn below node2
} else {
  // node2 is drawn below node1
}
local node1 = gui.get_node("my_node_1")
local node2 = gui.get_node("my_node_2")

if gui.get_index(node1) < gui.get_index(node2) then
    -- node1 is drawn below node2
else
    -- node2 is drawn below node1
end

Parameters

  • node: Opaque<"node"> — the node to retrieve the id from

Returns

  • index: number — the index of the node. 0️⃣ 0-based; passed to Defold unchanged.

gui.get_inherit_alpha(node: Opaque<"node">): boolean

gets the node inherit alpha state

Parameters

  • node: Opaque<"node"> — node from which to get the inherit alpha state

Returns

  • inherit_alpha: boolean — true or false

gui.get_inner_radius(node: Opaque<"node">): number

Returns the inner radius of a pie node. The radius is defined along the x-axis.

Parameters

  • node: Opaque<"node"> — node from where to get the inner radius

Returns

  • radius: number — inner radius

gui.get_layer(node: Opaque<"node">): Hash

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

Parameters

  • node: Opaque<"node"> — node from which to get the layer

Returns

  • layer: Hash — layer id

gui.get_layout(): Hash

gets the scene current layout

Returns

  • layout: Hash — layout id

gui.get_layout_objects(node: Opaque<"node">): gui.LayoutObject[]N

  • Since Defold 1.13.2

Returns the sprites and links found in the text node's current layout. Each object's x and y identify its lower-left corner relative to the text node's pivot, before applying the node's scale and rotation.

Parameters

  • node: Opaque<"node"> — text node to inspect

Returns

  • objects: gui.LayoutObject[] — layout objects in source order. 0️⃣ text_offset is 0-based; passed to Defold unchanged.

gui.get_layouts(): LuaTable<Hash, Vector3>

Returns a table mapping each layout id hash to a vector3(width, height, 0). For the default layout, the current scene resolution is returned. If a layout name is not present in the Display Profiles (or when no display profiles are assigned), the width/height pair is 0.

Returns

  • LuaTable<Hash, Vector3> — layout_id_hash -> vmath.vector3(width, height, 0)

gui.get_leading(node: Opaque<"node">): number

Returns the leading value for a text node.

Parameters

  • node: Opaque<"node"> — node from where to get the leading

Returns

  • leading: number — leading scaling value (default=1)

gui.get_line_break(node: Opaque<"node">): boolean

Returns whether a text node is in line-break mode or not. This is only useful for text nodes.

Parameters

  • node: Opaque<"node"> — node from which to get the line-break for

Returns

  • line_break: boolean — true or false

gui.get_material(node: Opaque<"node">): Hash

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

// Getting the material for a node, and assign it to another node:
const node1 = gui.get_node("my_node");
const node2 = gui.get_node("other_node");
const node1_material = gui.get_material(node1);
gui.set_material(node2, node1_material);
local node1 = gui.get_node("my_node")
local node2 = gui.get_node("other_node")
local node1_material = gui.get_material(node1)
gui.set_material(node2, node1_material)

Parameters

  • node: Opaque<"node"> — node to get the material for

Returns

  • materal: Hash — material id

gui.get_node(id: string | Hash): Opaque<"node">

Retrieves the node with the specified id.

// Gets a node by id and change its color:
const node = gui.get_node("my_node");
const red = vmath.vector4(1.0, 0.0, 0.0, 1.0);
gui.set_color(node, red);
local node = gui.get_node("my_node")
local red = vmath.vector4(1.0, 0.0, 0.0, 1.0)
gui.set_color(node, red)

Parameters

  • id: string | Hash — id of the node to retrieve

Returns

  • instance: Opaque<"node"> — a new node instance

gui.get_outer_bounds(node: Opaque<"node">): gui.PieBounds

Returns the outer bounds mode for a pie node.

Parameters

  • node: Opaque<"node"> — node from where to get the outer bounds mode

Returns

  • bounds_mode: gui.PieBounds — the outer bounds mode of the pie node

gui.get_outline(node: Opaque<"node">): Vector4

Returns the outline color of the supplied node. See gui.get_color for info how vectors encode color values.

Parameters

  • node: Opaque<"node"> — node to get the outline color from

Returns

  • color: Vector4 — outline color

gui.get_parent(node: Opaque<"node">): Opaque<"node"> | undefined

Returns the parent node of the specified node. If the supplied node does not have a parent, nil is returned.

Parameters

  • node: Opaque<"node"> — the node from which to retrieve its parent

Returns

  • parent: Opaque<"node"> | undefined — parent instance or nil

gui.get_particlefx(node: Opaque<"node">): Hash

Get the paricle fx for a gui node

Parameters

  • node: Opaque<"node"> — node to get particle fx for

Returns

  • particlefx: Hash — particle fx id

gui.get_perimeter_vertices(node: Opaque<"node">): number

Returns the number of generated vertices around the perimeter of a pie node.

Parameters

  • node: Opaque<"node"> — pie node

Returns

  • vertices: number — vertex count

gui.get_pivot(node: Opaque<"node">): gui.Pivot

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

Parameters

  • node: Opaque<"node"> — node to get pivot from

Returns

  • pivot: gui.Pivot — pivot constant
    • gui.PIVOT_CENTER
    • gui.PIVOT_N
    • gui.PIVOT_NE
    • gui.PIVOT_E
    • gui.PIVOT_SE
    • gui.PIVOT_S
    • gui.PIVOT_SW
    • gui.PIVOT_W
    • gui.PIVOT_NW

gui.get_position(node: Opaque<"node">): Vector3

Returns the position of the supplied node.

Parameters

  • node: Opaque<"node"> — node to get the position from

Returns

  • position: Vector3 — node position

gui.get_rotation(node: Opaque<"node">): Quaternion

Returns the rotation of the supplied node. The rotation is expressed as a quaternion

Parameters

  • node: Opaque<"node"> — node to get the rotation from

Returns

  • rotation: Quaternion — node rotation

gui.get_scale(node: Opaque<"node">): Vector3

Returns the scale of the supplied node.

Parameters

  • node: Opaque<"node"> — node to get the scale from

Returns

  • scale: Vector3 — node scale

gui.get_screen_position(node: Opaque<"node">): 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: Opaque<"node"> — node to get the screen position from

Returns

  • position: Vector3 — node screen position

gui.get_shadow(node: Opaque<"node">): Vector4

Returns the shadow color of the supplied node. See gui.get_color for info how vectors encode color values.

Parameters

  • node: Opaque<"node"> — node to get the shadow color from

Returns

  • color: Vector4 — node shadow color

gui.get_size(node: Opaque<"node">): Vector3

Returns the size of the supplied node.

Parameters

  • node: Opaque<"node"> — node to get the size from

Returns

  • size: Vector3 — node size

gui.get_size_mode(node: Opaque<"node">): gui.SizeMode

Returns the size of a node. The size mode defines how the node will adjust itself in size. Automatic size mode alters the node size based on the node's content. Automatic size mode works for Box nodes and Pie nodes which will both adjust their size to match the assigned image. Particle fx and Text nodes will ignore any size mode setting.

Parameters

  • node: Opaque<"node"> — node from which to get the size mode (node)

Returns

gui.get_slice9(node: Opaque<"node">): Vector4

Returns the slice9 configuration values for the node.

Parameters

  • node: Opaque<"node"> — node to manipulate

Returns

  • values: Vector4 — configuration values

gui.get_text(node: Opaque<"node">): string

Returns the text value of a text node. This is only useful for text nodes.

Parameters

  • node: Opaque<"node"> — node from which to get the text

Returns

  • text: string — text value

gui.get_texture(node: Opaque<"node">): Hash

Returns the texture of a node. 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: Opaque<"node"> — node to get texture from

Returns

  • texture: Hash — texture id

gui.get_tracking(node: Opaque<"node">): number

Returns the tracking value of a text node.

Parameters

  • node: Opaque<"node"> — node from where to get the tracking

Returns

  • tracking: number — tracking scaling number (default=0)

gui.get_tree(node: Opaque<"node"> | undefined): LuaTable<Hash, Opaque<"node">> & { get: LuaTableGetMethod<string, Opaque<"node">> }

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

Parameters

  • node: Opaque<"node"> | undefined — root node to get node tree from, or nil to get the whole scene; leaving the argument out raises an error

Returns

  • clones: LuaTable<Hash, Opaque<"node">> & { get: LuaTableGetMethod<string, Opaque<"node">> } — a table mapping node ids to the corresponding nodes

gui.get_type(node: Opaque<"node">): LuaMultiReturn<[gui.Type, number | undefined]>

gets the node type

Parameters

  • node: Opaque<"node"> — node from which to get the type

Returns

  • type: gui.Type — type
  • subtype: number | undefined — id of the custom type

gui.get_visible(node: Opaque<"node">): boolean

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

Parameters

  • node: Opaque<"node"> — node to query

Returns

  • visible: boolean — whether the node is visible or not

gui.get_width(): number

Returns the scene width.

Returns

  • width: number — scene width

gui.get_xanchor(node: Opaque<"node">): Exclude<gui.Anchor, typeof gui.ANCHOR_BOTTOM | typeof gui.ANCHOR_TOP>

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

Parameters

  • node: Opaque<"node"> — node to get x-anchor from

Returns

  • anchor: Exclude<gui.Anchor, typeof gui.ANCHOR_BOTTOM | typeof gui.ANCHOR_TOP> — anchor constant
    • gui.ANCHOR_NONE
    • gui.ANCHOR_LEFT
    • gui.ANCHOR_RIGHT

gui.get_yanchor(node: Opaque<"node">): Exclude<gui.Anchor, typeof gui.ANCHOR_LEFT | typeof gui.ANCHOR_RIGHT>

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

Parameters

  • node: Opaque<"node"> — node to get y-anchor from

Returns

  • anchor: Exclude<gui.Anchor, typeof gui.ANCHOR_LEFT | typeof gui.ANCHOR_RIGHT> — anchor constant
    • gui.ANCHOR_NONE
    • gui.ANCHOR_TOP
    • gui.ANCHOR_BOTTOM

gui.hide_keyboard(): void

Hides the on-display touch keyboard on the device.

gui.is_enabled(node: Opaque<"node">, recursive?: boolean): boolean

Returns true if a node is enabled and false if it's not. Disabled nodes are not rendered and animations acting on them are not evaluated.

Parameters

  • node: Opaque<"node"> — node to query
  • recursive?: boolean — check hierarchy recursively

Returns

  • enabled: boolean — whether the node is enabled or not

gui.move_above(node: Opaque<"node">, reference: Opaque<"node"> | undefined): void

Alters the ordering of the two supplied nodes by moving the first node above the second. If the second argument is nil the first node is moved to the top.

Parameters

  • node: Opaque<"node"> — to move
  • reference: Opaque<"node"> | undefined — reference node above which the first node should be moved

gui.move_below(node: Opaque<"node">, reference: Opaque<"node"> | undefined): void

Alters the ordering of the two supplied nodes by moving the first node below the second. If the second argument is nil the first node is moved to the bottom.

Parameters

  • node: Opaque<"node"> — to move
  • reference: Opaque<"node"> | undefined — reference node below which the first node should be moved

gui.new_box_node(pos: Vector3 | Vector4, size: Vector3): Opaque<"node">

Dynamically create a new box node.

Parameters

  • pos: Vector3 | Vector4 — node position
  • size: Vector3 — node size

Returns

  • node: Opaque<"node"> — new box node

gui.new_particlefx_node(pos: Vector3 | Vector4, particlefx: Hash | string): Opaque<"node">

Dynamically create a particle fx node.

Parameters

  • pos: Vector3 | Vector4 — node position
  • particlefx: Hash | string — particle fx resource name

Returns

  • node: Opaque<"node"> — new particle fx node

gui.new_pie_node(pos: Vector3 | Vector4, size: Vector3): Opaque<"node">

Dynamically create a new pie node.

Parameters

  • pos: Vector3 | Vector4 — node position
  • size: Vector3 — node size

Returns

  • node: Opaque<"node"> — new pie node

gui.new_text_node(pos: Vector3 | Vector4, text: string): Opaque<"node">

Dynamically create a new text node.

Parameters

  • pos: Vector3 | Vector4 — node position
  • text: string — node text

Returns

  • node: Opaque<"node"> — new text node

gui.new_texture(2 overloads): LuaMultiReturn<[boolean, gui.Result | undefined]>C

Dynamically create a new texture.

  1. (texture_id: string | Hash, width: number, height: number, type: string | image.Type, buffer: string)

    • Signature changed in Defold 1.13.2 — before: (texture_id: string | Hash, width: number, height: number, type: string | Opaque<"constant">, buffer: string): LuaMultiReturn<[boolean, number | undefined]>

  2. (texture_id: string | Hash, width: number, height: number, type: string | image.Type, buffer: string, flip: boolean)

    Parameters

    • texture_id: string | Hash — texture id
    • width: number — texture width
    • height: number — texture height
    • type: string | image.Type — texture type
      • "rgb" or image.TYPE_RGB - RGB
      • "rgba" or image.TYPE_RGBA - RGBA
      • "l" or image.TYPE_LUMINANCE - LUMINANCE
      • "astc" - ASTC compressed format
    • buffer: string — texture data
    • flip: boolean — flip texture vertically

    Returns

    • success: boolean — texture creation was successful
    • code: gui.Result | undefined — one of the gui.RESULT_* codes if unsuccessful
    • Signature changed in Defold 1.13.2 — before: (texture_id: string | Hash, width: number, height: number, type: string | Opaque<"constant">, buffer: string, flip: boolean): LuaMultiReturn<[boolean, number | undefined]>

How to create a texture and apply it to a new box node:

export default defineGuiScript({
  init(self) {
    const w = 200;
    const h = 300;

    // A nice orange. String with the RGB values.
    const orange = String.fromCharCode(0xff, 0x80, 0x10);

    // Create the texture. Repeat the color string for each pixel.
    const [ok, reason] = gui.new_texture("orange_tx", w, h, "rgb", orange.repeat(w * h));
    if (ok) {
      // Create a box node and apply the texture to it.
      const n = gui.new_box_node(vmath.vector3(200, 200, 0), vmath.vector3(w, h, 0));
      gui.set_texture(n, "orange_tx");
    } else {
      // Could not create texture for some reason...
      if (reason === gui.RESULT_TEXTURE_ALREADY_EXISTS) {
        // ...
      } else {
        // ...
      }
    }
  },
});
function init(self)
     local w = 200
     local h = 300

     -- A nice orange. String with the RGB values.
     local orange = string.char(0xff) .. string.char(0x80) .. string.char(0x10)

     -- Create the texture. Repeat the color string for each pixel.
     local ok, reason = gui.new_texture("orange_tx", w, h, "rgb", string.rep(orange, w * h))
     if ok then
         -- Create a box node and apply the texture to it.
         local n = gui.new_box_node(vmath.vector3(200, 200, 0), vmath.vector3(w, h, 0))
         gui.set_texture(n, "orange_tx")
     else
         -- Could not create texture for some reason...
         if reason == gui.RESULT_TEXTURE_ALREADY_EXISTS then
             ...
         else
             ...
         end
     end
end

How to create a texture using .astc format

const size = 4;
const pos = vmath.vector3(200, 200, 0);
const path = "/assets/images/logo_4x4.astc";
const [data] = sys.load_resource(path);
if (data !== undefined) {
  const n = gui.new_box_node(pos, vmath.vector3(size, size, 0));
  // size is read from the .astc buffer
  // flip is not supported
  gui.new_texture(path, 0, 0, "astc", data, false);
  gui.set_texture(n, path);
}
local path = "/assets/images/logo_4x4.astc"
local buffer = sys.load_resource(path)
local n = gui.new_box_node(pos, vmath.vector3(size, size, 0))
-- size is read from the .astc buffer
-- flip is not supported
gui.new_texture(path, 0, 0, "astc", buffer, false)
gui.set_texture(n, path)

gui.pick_node(node: Opaque<"node">, x: number, y: number): boolean

Tests whether a coordinate is within the bounding box of a node.

Parameters

  • node: Opaque<"node"> — node to be tested for picking
  • x: number — x-coordinate (see on_input )
  • y: number — y-coordinate (see on_input )

Returns

  • pickable: boolean — pick result

gui.play_flipbook(2 overloads): void

Play flipbook animation on a box or pie node. The current node texture must contain the animation. Use this function to set one-frame still images on the node.

  1. (node: Opaque<"node">, animation: string | Hash, complete_function?: (self: unknown, node: Opaque<"node">) => void)

  2. (node: Opaque<"node">, animation: string | Hash, complete_function: ((self: unknown, node: Opaque<"node">) => void) | undefined, play_properties: gui.PlayProperties)

    Parameters

    • node: Opaque<"node"> — node to set animation for
    • animation: string | Hash — animation id
    • complete_function: ((self: unknown, node: Opaque<"node">) => void) | undefined — optional function to call when the animation has completed self script_instance The current script instance. node node The node that is animated.
    • play_properties: gui.PlayProperties — optional playback properties

Set the texture of a node to a flipbook animation from an atlas:

function anim_callback(self: unknown, node: unknown) {
  // Take action after animation has played.
}

export default defineGuiScript({
  init(self) {
    // Create a new node and set the texture to a flipbook animation
    const node = gui.get_node("button_node");
    gui.set_texture(node, "gui_sprites");
    gui.play_flipbook(node, "animated_button");
  },
});
local function anim_callback(self, node)
    -- Take action after animation has played.
end

function init(self)
    -- Create a new node and set the texture to a flipbook animation
    local node = gui.get_node("button_node")
    gui.set_texture(node, "gui_sprites")
    gui.play_flipbook(node, "animated_button")
end

Set the texture of a node to an image from an atlas:

// Create a new node and set the texture to a "button.png" from atlas
const node = gui.get_node("button_node");
gui.set_texture(node, "gui_sprites");
gui.play_flipbook(node, "button");
-- Create a new node and set the texture to a "button.png" from atlas
local node = gui.get_node("button_node")
gui.set_texture(node, "gui_sprites")
gui.play_flipbook(node, "button")

gui.play_particlefx(node: Opaque<"node">, emitter_state_function?: (self: unknown, node: Opaque<"node"> | undefined, emitter: Hash, state: particlefx.EmitterState) => void): void

Plays the paricle fx for a gui node

// How to play a particle fx when a gui node is created.
// The callback receives the gui node, the hash of the id
// of the emitter, and the new state of the emitter as particlefx.EMITTER_STATE_<STATE>.
export default defineGuiScript({
  init(self) {
    gui.play_particlefx(gui.get_node("particlefx"), (self, node, emitter, state) => {
      if (emitter === hash("exhaust") && state === particlefx.EMITTER_STATE_POSTSPAWN) {
        // exhaust is done spawning particles...
      }
    });
  },
});
local function emitter_state_change(self, node, emitter, state)
  if emitter == hash("exhaust") and state == particlefx.EMITTER_STATE_POSTSPAWN then
    -- exhaust is done spawning particles...
  end
end

function init(self)
    gui.play_particlefx(gui.get_node("particlefx"), emitter_state_change)
end

Parameters

  • node: Opaque<"node"> — node to play particle fx for
  • emitter_state_function?: (self: unknown, node: Opaque<"node"> | undefined, emitter: Hash, state: particlefx.EmitterState) => void — optional callback function that will be called when an emitter attached to this particlefx changes state.

gui.reset_keyboard(): void

Resets the input context of keyboard. This will clear marked text.

gui.reset_material(node: Opaque<"node">): void

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

// Resetting the material for a node:
const node = gui.get_node("my_node");
gui.reset_material(node);
local node = gui.get_node("my_node")
gui.reset_material(node)

Parameters

  • node: Opaque<"node"> — node to reset the material for

gui.reset_nodes(): void

Resets all nodes in the current GUI scene to their initial state. The reset only applies to static node loaded from the scene. Nodes that are created dynamically from script are not affected.

gui.screen_to_local(node: Opaque<"node">, screen_position: Vector3 | Vector4): Vector3

Converts a screen-space position to the local position value for the supplied node. The conversion takes the parent transform, anchors, adjust mode, and adjust reference into account.

// Animate a node to the pressed pointer position:
export default defineGuiScript({
  init() {
    msg.post(".", "acquire_input_focus");
    return { marker: gui.get_node("marker") };
  },

  on_input(self, action_id, action) {
    if (
      action_id === hash("touch") &&
      action.pressed &&
      action.screen_x !== undefined &&
      action.screen_y !== undefined
    ) {
      const screen_position = vmath.vector3(action.screen_x, action.screen_y, 0);
      const target_position = gui.screen_to_local(self.marker, screen_position);
      gui.animate(self.marker, gui.PROP_POSITION, target_position, gui.EASING_OUTQUAD, 0.2);
      return true;
    }
  },
});
function init(self)
    msg.post(".", "acquire_input_focus")
    self.marker = gui.get_node("marker")
end

function on_input(self, action_id, action)
    if action_id == hash("touch") and action.pressed then
        local screen_position = vmath.vector3(action.screen_x, action.screen_y, 0)
        local target_position = gui.screen_to_local(self.marker, screen_position)
        gui.animate(self.marker, gui.PROP_POSITION, target_position, gui.EASING_OUTQUAD, 0.2)
        return true
    end
end

Parameters

  • node: Opaque<"node"> — node whose local position space should be used
  • screen_position: Vector3 | Vector4 — screen-space position

Returns

  • local_position: Vector3 — local position value for the node

gui.set(6 overloads): voidC

  • 1 overload added in Defold 1.13.1
  1. <K extends keyof gui.NodeProperties | gui.Prop>(node: Opaque<"node">, property: K, value: NodePropertyWrite<NodePropertyName<K>>)

    Instead of using specific setters such as gui.set_position or gui.set_scale, you can use gui.set instead and supply the property as a string or a gui.PROP_* constant. Only the node properties gui.get lists are supported.

    The value depends on the property name. Setting "rotation" takes a vmath.quat, which differs from gui.set_rotation; to set the rotation in degrees, set "euler" instead. The rotation and euler properties are linked, so changing one changes the other. Every other vector property takes a vmath.vector4 or a vmath.vector3, and a component such as "position.x" or one of the four scalar properties takes a single number.

  2. (node: Opaque<"node">, property: Hash, value: number | Vector4 | Vector3 | Quaternion | Matrix4 | Hash)

    Sets a material constant of a node, or any property named by a hash. If a material specifies a constant called tint in the .material file, set it with gui.set(node, hash("tint"), vmath.vector4(1, 0, 0, 1)), or pass a vmath.matrix4 if the constant is a matrix. To set one element of an array constant, pass an options table with index set.

  3. (node: Opaque<"node">, property: Hash, value: number | Vector4 | Vector3 | Quaternion | Matrix4 | Hash, options: gui.PropertyOptions)

    Same description as form 2.

    Parameters

    • node: Opaque<"node"> — node to set the property for, or msg.url() to the gui itself
    • property: Hash — the property to set
    • value: number | Vector4 | Vector3 | Quaternion | Matrix4 | Hash — the property to set
    • options: gui.PropertyOptions — optional options table (only applicable for material constants)
      • index number index into array property (1 based)
      • key hash name of internal property
      ⚠️ index is 1-based; passed to Defold unchanged.
  4. (url: Url, property: "material" | "materials" | "fonts" | "textures" | Hash, value: Hash)

    Sets a resource property of the gui component itself, addressed with msg.url(): "material", or the "materials", "fonts" or "textures" entry named by the key option. A property a native extension registers is named by a hash.

  5. (url: Url, property: "material" | "materials" | "fonts" | "textures" | Hash, value: Hash, options: gui.PropertyOptions)

    Same description as form 4.

  6. (url: Url, property: "textures", value: undefined, options: { key: string | Hash }) N

    • Since Defold 1.13.1

    Removes the runtime texture mapping the key option names from the gui component itself. Needs Defold 1.13.1 or later.

Updates the position property on an existing node:

const node = gui.get_node("my_box_node");
const node_position = gui.get(node, "position");
gui.set(node, "position.x", node_position.x + 128);
local node = gui.get_node("my_box_node")
local node_position = gui.get(node, "position")
gui.set(node, "position.x", node_position.x + 128)

Updates the rotation property on an existing node:

const node = gui.get_node("my_box_node");
gui.set(node, "rotation", vmath.quat_rotation_z(math.rad(45)));
// this is equivalent to:
gui.set(node, "euler.z", 45);
// or using the entire vector:
gui.set(node, "euler", vmath.vector3(0, 0, 45));
// or using the set_rotation
gui.set_rotation(node, vmath.vector3(0, 0, 45));
local node = gui.get_node("my_box_node")
gui.set(node, "rotation", vmath.quat_rotation_z(math.rad(45)))
-- this is equivalent to:
gui.set(node, "euler.z", 45)
-- or using the entire vector:
gui.set(node, "euler", vmath.vector3(0,0,45))
-- or using the set_rotation
gui.set_rotation(node, vmath.vector3(0,0,45))

Sets various material constants for a node:

const node = gui.get_node("my_box_node");
gui.set(node, hash("tint"), vmath.vector4(1, 0, 0, 1));
// matrix4 is also supported
gui.set(node, hash("light_matrix"), vmath.matrix4());
// update a constant in an array at position 4. the array is specified in the shader as:
// uniform vec4 tint_array[4]; // lua is 1 based, shader is 0 based
gui.set(node, hash("tint_array"), vmath.vector4(1, 0, 0, 1), { index: 4 });
// update a matrix constant in an array at position 4. the array is specified in the shader as:
// uniform mat4 light_matrix_array[4];
gui.set(node, hash("light_matrix_array"), vmath.matrix4(), { index: 4 });
// update a sub-element in a constant
gui.set(node, hash("tint.x"), 1);
// update a sub-element in an array constant at position 4
gui.set(node, hash("tint_array.x"), 1, { index: 4 });
local node = gui.get_node("my_box_node")
gui.set(node, "tint", vmath.vector4(1,0,0,1))
-- matrix4 is also supported
gui.set(node, "light_matrix", vmath.matrix4())
-- update a constant in an array at position 4. the array is specified in the shader as:
-- uniform vec4 tint_array[4]; // lua is 1 based, shader is 0 based
gui.set(node, "tint_array", vmath.vector4(1,0,0,1), { index = 4 })
-- update a matrix constant in an array at position 4. the array is specified in the shader as:
-- uniform mat4 light_matrix_array[4];
gui.set(node, "light_matrix_array", vmath.matrix4(), { index = 4 })
-- update a sub-element in a constant
gui.set(node, "tint.x", 1)
-- update a sub-element in an array constant at position 4
gui.set(node, "tint_array.x", 1, {index = 4})

Set a named property

export default defineGuiScript({
  on_message(self, message_id, message) {
    if (message_id === hash("set_font") && types.is_hash(message.font)) {
      gui.set(msg.url(), "fonts", message.font, { key: "my_font_name" });
      gui.set_font(gui.get_node("text"), "my_font_name");
    } else if (message_id === hash("set_texture") && types.is_hash(message.texture)) {
      gui.set(msg.url(), "textures", message.texture, { key: "my_texture" });
      gui.set_texture(gui.get_node("box"), "my_texture");
      gui.play_flipbook(gui.get_node("box"), "logo_256");
    }
  },
});
function on_message(self, message_id, message, sender)
   if message_id == hash("set_font") then
       gui.set(msg.url(), "fonts", message.font, {key = "my_font_name"})
       gui.set_font(gui.get_node("text"), "my_font_name")
   elseif message_id == hash("set_texture") then
       gui.set(msg.url(), "textures", message.texture, {key = "my_texture"})
       gui.set_texture(gui.get_node("box"), "my_texture")
       gui.play_flipbook(gui.get_node("box"), "logo_256")
   end
end

gui.set_adjust_mode(node: Opaque<"node">, adjust_mode: gui.Adjust): void

Sets the adjust mode on a node. The adjust mode defines how the node will adjust itself to screen resolutions that differs from the one in the project settings.

Parameters

  • node: Opaque<"node"> — node to set adjust mode for
  • adjust_mode: gui.Adjust — adjust mode to set

gui.set_alpha(node: Opaque<"node">, alpha: number): void

sets the node alpha

Parameters

  • node: Opaque<"node"> — node for which to set alpha
  • alpha: number — 0..1 alpha color

gui.set_blend_mode(node: Opaque<"node">, blend_mode: gui.Blend): void

Set the blend mode of a node. Blend mode defines how the node will be blended with the background.

Parameters

  • node: Opaque<"node"> — node to set blend mode for
  • blend_mode: gui.Blend — blend mode to set

gui.set_clipping_inverted(node: Opaque<"node">, inverted: boolean): void

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

Parameters

  • node: Opaque<"node"> — node to set clipping inverted state for
  • inverted: boolean — true or false

gui.set_clipping_mode(node: Opaque<"node">, clipping_mode: gui.ClippingMode): void

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

Parameters

  • node: Opaque<"node"> — node to set clipping mode for
  • clipping_mode: gui.ClippingMode — clipping mode to set
    • gui.CLIPPING_MODE_NONE
    • gui.CLIPPING_MODE_STENCIL

gui.set_clipping_visible(node: Opaque<"node">, visible: boolean): void

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: Opaque<"node"> — node to set clipping visibility for
  • visible: boolean — true or false

gui.set_color(node: Opaque<"node">, color: Vector3 | Vector4): void

Sets the color of the supplied node. The components of the supplied vector3 or vector4 should contain the color channel values in the range 0 to 1:

Component Color value

x Red value

y Green value

z Blue value

w vector4 Alpha value

Parameters

  • node: Opaque<"node"> — node to set the color for
  • color: Vector3 | Vector4 — new color

gui.set_enabled(node: Opaque<"node">, enabled: boolean): void

Sets a node to the disabled or enabled state. Disabled nodes are not rendered and animations acting on them are not evaluated.

Parameters

  • node: Opaque<"node"> — node to be enabled/disabled
  • enabled: boolean — whether the node should be enabled or not

gui.set_euler(node: Opaque<"node">, rotation: Vector3 | Vector4): void

Sets the rotation of the supplied node. The rotation is expressed in degree Euler angles.

Parameters

  • node: Opaque<"node"> — node to set the rotation for
  • rotation: Vector3 | Vector4 — new rotation

gui.set_fill_angle(node: Opaque<"node">, angle: number): void

Set the sector angle of a pie node.

Parameters

  • node: Opaque<"node"> — node to set the fill angle for
  • angle: number — sector angle

gui.set_flipbook_cursor(node: Opaque<"node">, cursor: number): void

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

Parameters

  • node: Opaque<"node"> — node to set the cursor for
  • cursor: number — cursor value

gui.set_flipbook_playback_rate(node: Opaque<"node">, playback_rate: number): void

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

Parameters

  • node: Opaque<"node"> — node to set the cursor for
  • playback_rate: number — playback rate

gui.set_font(node: Opaque<"node">, font: string | Hash): void

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

Parameters

  • node: Opaque<"node"> — node for which to set the font
  • font: string | Hash — font id

gui.set_id(node: Opaque<"node">, id: string | Hash): void

Set the id of the specicied node to a new value. 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.

// Create a new node and set its id:
const pos = vmath.vector3(100, 100, 0);
const size = vmath.vector3(100, 100, 0);
const node = gui.new_box_node(pos, size);
gui.set_id(node, "my_new_node");
local pos = vmath.vector3(100, 100, 0)
local size = vmath.vector3(100, 100, 0)
local node = gui.new_box_node(pos, size)
gui.set_id(node, "my_new_node")

Parameters

  • node: Opaque<"node"> — node to set the id for
  • id: string | Hash — id to set

gui.set_inherit_alpha(node: Opaque<"node">, inherit_alpha: boolean): void

sets the node inherit alpha state

Parameters

  • node: Opaque<"node"> — node from which to set the inherit alpha state
  • inherit_alpha: boolean — true or false

gui.set_inner_radius(node: Opaque<"node">, radius: number): void

Sets the inner radius of a pie node. The radius is defined along the x-axis.

Parameters

  • node: Opaque<"node"> — node to set the inner radius for
  • radius: number — inner radius

gui.set_layer(node: Opaque<"node">, layer: string | Hash): void

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

Parameters

  • node: Opaque<"node"> — node for which to set the layer
  • layer: string | Hash — layer id

gui.set_layout(layout: string | Hash): boolean

Applies a named layout on the GUI scene. This re-applies per-layout node descriptors and, if a matching Display Profile exists, updates the scene resolution. Emits the "layout_changed" message to the scene script when the layout actually changes.

Parameters

  • layout: string | Hash — the layout id to apply

Returns

  • boolean — true if the layout exists in the scene and was applied, false otherwise

gui.set_leading(node: Opaque<"node">, leading: number): void

Sets the leading value for a text node. This value is used to scale the line spacing of text.

Parameters

  • node: Opaque<"node"> — node for which to set the leading
  • leading: number — a scaling value for the line spacing (default=1)

gui.set_line_break(node: Opaque<"node">, line_break: boolean): void

Sets the line-break mode on a text node. This is only useful for text nodes.

Parameters

  • node: Opaque<"node"> — node to set line-break for
  • line_break: boolean — true or false

gui.set_material(node: Opaque<"node">, material: string | Hash): 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(node_id) instead.

// Assign an existing material to a node:
const node = gui.get_node("my_node");
gui.set_material(node, "my_material");
local node = gui.get_node("my_node")
gui.set_material(node, "my_material")

Parameters

  • node: Opaque<"node"> — node to set material for
  • material: string | Hash — material id

gui.set_outer_bounds(node: Opaque<"node">, bounds_mode: gui.PieBounds): void

Sets the outer bounds mode for a pie node.

Parameters

  • node: Opaque<"node"> — node for which to set the outer bounds mode
  • bounds_mode: gui.PieBounds — the outer bounds mode of the pie node

gui.set_outline(node: Opaque<"node">, color: Vector3 | Vector4): void

Sets the outline color of the supplied node. See gui.set_color for info how vectors encode color values.

Parameters

  • node: Opaque<"node"> — node to set the outline color for
  • color: Vector3 | Vector4 — new outline color

gui.set_parent(node: Opaque<"node">, parent: Opaque<"node"> | undefined, keep_scene_transform?: boolean): void

Sets the parent node of the specified node.

Parameters

  • node: Opaque<"node"> — node for which to set its parent
  • parent: Opaque<"node"> | undefined — parent node to set, pass nil to remove parent
  • keep_scene_transform?: boolean — optional flag to make the scene position being perserved

gui.set_particlefx(node: Opaque<"node">, particlefx: Hash | string): void

Set the paricle fx for a gui node

Parameters

  • node: Opaque<"node"> — node to set particle fx for
  • particlefx: Hash | string — particle fx id

gui.set_perimeter_vertices(node: Opaque<"node">, vertices: number): void

Sets the number of generated vertices around the perimeter of a pie node.

Parameters

  • node: Opaque<"node"> — pie node
  • vertices: number — vertex count

gui.set_pivot(node: Opaque<"node">, pivot: gui.Pivot): void

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

Parameters

  • node: Opaque<"node"> — node to set pivot for
  • pivot: gui.Pivot — pivot constant
    • gui.PIVOT_CENTER
    • gui.PIVOT_N
    • gui.PIVOT_NE
    • gui.PIVOT_E
    • gui.PIVOT_SE
    • gui.PIVOT_S
    • gui.PIVOT_SW
    • gui.PIVOT_W
    • gui.PIVOT_NW

gui.set_position(node: Opaque<"node">, position: Vector3 | Vector4): void

Sets the position of the supplied node.

Parameters

  • node: Opaque<"node"> — node to set the position for
  • position: Vector3 | Vector4 — new position

gui.set_render_order(order: number): 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: number — rendering order (0-15)

gui.set_rotation(node: Opaque<"node">, rotation: Quaternion | Vector4 | Vector3): void

Sets the rotation of the supplied node. The rotation is expressed as a quaternion

Parameters

  • node: Opaque<"node"> — node to set the rotation for
  • rotation: Quaternion | Vector4 | Vector3 — new rotation

gui.set_safe_area_mode(mode: gui.SafeArea): void

Sets how the safe area is applied to this gui scene.

Parameters

gui.set_scale(node: Opaque<"node">, scale: Vector3 | Vector4): void

Sets the scaling of the supplied node.

Parameters

  • node: Opaque<"node"> — node to set the scale for
  • scale: Vector3 | Vector4 — new scale

gui.set_screen_position(node: Opaque<"node">, screen_position: Vector3 | Vector4): void

Set the screen position to the supplied node

Parameters

  • node: Opaque<"node"> — node to set the screen position to
  • screen_position: Vector3 | Vector4 — screen position

gui.set_shadow(node: Opaque<"node">, color: Vector3 | Vector4): void

Sets the shadow color of the supplied node. See gui.set_color for info how vectors encode color values.

Parameters

  • node: Opaque<"node"> — node to set the shadow color for
  • color: Vector3 | Vector4 — new shadow color

gui.set_size(node: Opaque<"node">, size: Vector3 | Vector4): void

Sets the size of the supplied node. You can only set size on nodes with size mode set to SIZE_MODE_MANUAL

Parameters

  • node: Opaque<"node"> — node to set the size for
  • size: Vector3 | Vector4 — new size

gui.set_size_mode(node: Opaque<"node">, size_mode: gui.SizeMode): void

Sets the size mode of a node. The size mode defines how the node will adjust itself in size. Automatic size mode alters the node size based on the node's content. Automatic size mode works for Box nodes and Pie nodes which will both adjust their size to match the assigned image. Particle fx and Text nodes will ignore any size mode setting.

Parameters

  • node: Opaque<"node"> — node to set size mode for
  • size_mode: gui.SizeMode — size mode to set

gui.set_slice9(node: Opaque<"node">, values: Vector4): void

Set the slice9 configuration values for the node.

Parameters

  • node: Opaque<"node"> — node to manipulate
  • values: Vector4 — new values

gui.set_text(node: Opaque<"node">, text: string | number): void

Set the text value of a text node. This is only useful for text nodes.

Parameters

  • node: Opaque<"node"> — node to set text for
  • text: string | number — text to set

gui.set_texture(node: Opaque<"node">, texture: string | Hash): void

Set the texture on a box or pie node. The texture must be mapped to the gui scene in the gui editor. The function points out which texture the node should render from. If the texture is an atlas, further information is needed to select which image/animation in the atlas to render. In such cases, use gui.play_flipbook() in addition to this function.

To set a texture (or animation) from an atlas:

const node = gui.get_node("box_node");
gui.set_texture(node, "my_atlas");
gui.play_flipbook(node, "image");
local node = gui.get_node("box_node")
gui.set_texture(node, "my_atlas")
gui.play_flipbook(node, "image")

Set a dynamically created texture to a node. Note that there is only one texture image in this case so gui.set_texture() is sufficient.

const w = 200;
const h = 300;
// A nice orange. String with the RGB values.
const orange = String.fromCharCode(0xff, 0x80, 0x10);
// Create the texture. Repeat the color string for each pixel.
const [ok] = gui.new_texture("orange_tx", w, h, "rgb", orange.repeat(w * h));
if (ok) {
  const node = gui.get_node("box_node");
  gui.set_texture(node, "orange_tx");
}
local w = 200
local h = 300
-- A nice orange. String with the RGB values.
local orange = string.char(0xff) .. string.char(0x80) .. string.char(0x10)
-- Create the texture. Repeat the color string for each pixel.
if gui.new_texture("orange_tx", w, h, "rgb", string.rep(orange, w * h)) then
    local node = gui.get_node("box_node")
    gui.set_texture(node, "orange_tx")
end

Parameters

  • node: Opaque<"node"> — node to set texture for
  • texture: string | Hash — texture id

gui.set_texture_data(2 overloads): booleanC

Set the texture buffer data for a dynamically created texture.

  1. (texture: string | Hash, width: number, height: number, type: string | image.Type, buffer: string)

    • Signature changed in Defold 1.13.2 — before: (texture: string | Hash, width: number, height: number, type: string | Opaque<"constant">, buffer: string)

  2. (texture: string | Hash, width: number, height: number, type: string | image.Type, buffer: string, flip: boolean)

    Parameters

    • texture: string | Hash — texture id
    • width: number — texture width
    • height: number — texture height
    • type: string | image.Type — texture type
      • "rgb" or image.TYPE_RGB - RGB
      • "rgba" or image.TYPE_RGBA - RGBA
      • "l" or image.TYPE_LUMINANCE - LUMINANCE
      • "astc" - ASTC compressed format
    • buffer: string — texture data
    • flip: boolean — flip texture vertically

    Returns

    • success: boolean — setting the data was successful
    • Signature changed in Defold 1.13.2 — before: (texture: string | Hash, width: number, height: number, type: string | Opaque<"constant">, buffer: string, flip: boolean)

export default defineGuiScript({
  init(self) {
    const w = 200;
    const h = 300;

    // Create a dynamic texture, all white.
    if (gui.new_texture("dynamic_tx", w, h, "rgb", String.fromCharCode(0xff).repeat(w * h * 3))) {
      // Create a box node and apply the texture to it.
      const n = gui.new_box_node(vmath.vector3(200, 200, 0), vmath.vector3(w, h, 0));
      gui.set_texture(n, "dynamic_tx");

      // ...

      // Change the data in the texture to a nice orange.
      const orange = String.fromCharCode(0xff, 0x80, 0x10);
      if (gui.set_texture_data("dynamic_tx", w, h, "rgb", orange.repeat(w * h))) {
        // Go on and to more stuff
        // ...
      }
    } else {
      // Something went wrong
      // ...
    }
  },
});
function init(self)
     local w = 200
     local h = 300

     -- Create a dynamic texture, all white.
     if gui.new_texture("dynamic_tx", w, h, "rgb", string.rep(string.char(0xff), w * h * 3)) then
         -- Create a box node and apply the texture to it.
         local n = gui.new_box_node(vmath.vector3(200, 200, 0), vmath.vector3(w, h, 0))
         gui.set_texture(n, "dynamic_tx")

         ...

         -- Change the data in the texture to a nice orange.
         local orange = string.char(0xff) .. string.char(0x80) .. string.char(0x10)
         if gui.set_texture_data("dynamic_tx", w, h, "rgb", string.rep(orange, w * h)) then
             -- Go on and to more stuff
             ...
         end
     else
         -- Something went wrong
         ...
     end
end

gui.set_tracking(node: Opaque<"node">, tracking: number): void

Sets the tracking value of a text node. This value is used to adjust the vertical spacing of characters in the text.

Parameters

  • node: Opaque<"node"> — node for which to set the tracking
  • tracking: number — a scaling number for the letter spacing (default=0)

gui.set_visible(node: Opaque<"node">, visible: boolean): void

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

Parameters

  • node: Opaque<"node"> — node to be visible or not
  • visible: boolean — whether the node should be visible or not

gui.set_xanchor(node: Opaque<"node">, anchor: Exclude<gui.Anchor, typeof gui.ANCHOR_BOTTOM | typeof gui.ANCHOR_TOP>): void

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

Parameters

  • node: Opaque<"node"> — node to set x-anchor for
  • anchor: Exclude<gui.Anchor, typeof gui.ANCHOR_BOTTOM | typeof gui.ANCHOR_TOP> — anchor constant
    • gui.ANCHOR_NONE
    • gui.ANCHOR_LEFT
    • gui.ANCHOR_RIGHT

gui.set_yanchor(node: Opaque<"node">, anchor: Exclude<gui.Anchor, typeof gui.ANCHOR_LEFT | typeof gui.ANCHOR_RIGHT>): void

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

Parameters

  • node: Opaque<"node"> — node to set y-anchor for
  • anchor: Exclude<gui.Anchor, typeof gui.ANCHOR_LEFT | typeof gui.ANCHOR_RIGHT> — anchor constant
    • gui.ANCHOR_NONE
    • gui.ANCHOR_TOP
    • gui.ANCHOR_BOTTOM

gui.show_keyboard(type: gui.KeyboardType, autoclose: boolean): void

Shows the on-display touch keyboard. 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: gui.KeyboardType — keyboard type
  • autoclose: boolean — if the keyboard should automatically close when clicking outside

gui.stop_particlefx(2 overloads): void

Stops the particle fx for a gui node

  1. (node: Opaque<"node">)

  2. (node: Opaque<"node">, options: particlefx.StopOptions)

    Parameters

    • node: Opaque<"node"> — node to stop particle fx for
    • options: particlefx.StopOptions — options used when stopping the particle fx

Constants

gui.ADJUST_FIT: number & { readonly __brand: "gui.ADJUST_FIT" }

fit adjust mode Adjust mode is used when the screen resolution differs from the project settings. The fit mode ensures that the entire node is visible in the adjusted gui scene.

gui.ADJUST_STRETCH: number & { readonly __brand: "gui.ADJUST_STRETCH" }

stretch adjust mode Adjust mode is used when the screen resolution differs from the project settings. The stretch mode ensures that the node is displayed as is in the adjusted gui scene, which might scale it non-uniformally.

gui.ADJUST_ZOOM: number & { readonly __brand: "gui.ADJUST_ZOOM" }

zoom adjust mode Adjust mode is used when the screen resolution differs from the project settings. The zoom mode ensures that the node fills its entire area and might make the node exceed it.

gui.ANCHOR_BOTTOM: number & { readonly __brand: "gui.ANCHOR_BOTTOM" }

bottom y-anchor

gui.ANCHOR_LEFT: number & { readonly __brand: "gui.ANCHOR_LEFT" }

left x-anchor

gui.ANCHOR_NONE: number & { readonly __brand: "gui.ANCHOR_NONE" }

no anchor

gui.ANCHOR_RIGHT: number & { readonly __brand: "gui.ANCHOR_RIGHT" }

right x-anchor

gui.ANCHOR_TOP: number & { readonly __brand: "gui.ANCHOR_TOP" }

top y-anchor

gui.BLEND_ADD: number & { readonly __brand: "gui.BLEND_ADD" }

additive blending

gui.BLEND_ADD_ALPHA: number & { readonly __brand: "gui.BLEND_ADD_ALPHA" }

additive alpha blending

gui.BLEND_ALPHA: number & { readonly __brand: "gui.BLEND_ALPHA" }

alpha blending

gui.BLEND_MULT: number & { readonly __brand: "gui.BLEND_MULT" }

multiply blending

gui.BLEND_SCREEN: number & { readonly __brand: "gui.BLEND_SCREEN" }

screen blending

gui.CLIPPING_MODE_NONE: number & { readonly __brand: "gui.CLIPPING_MODE_NONE" }

clipping mode none

gui.CLIPPING_MODE_STENCIL: number & { readonly __brand: "gui.CLIPPING_MODE_STENCIL" }

clipping mode stencil

gui.EASING_INBACK: number & { readonly __brand: "gui.EASING_INBACK" }

in-back

gui.EASING_INBOUNCE: number & { readonly __brand: "gui.EASING_INBOUNCE" }

in-bounce

gui.EASING_INCIRC: number & { readonly __brand: "gui.EASING_INCIRC" }

in-circlic

gui.EASING_INCUBIC: number & { readonly __brand: "gui.EASING_INCUBIC" }

in-cubic

gui.EASING_INELASTIC: number & { readonly __brand: "gui.EASING_INELASTIC" }

in-elastic

gui.EASING_INEXPO: number & { readonly __brand: "gui.EASING_INEXPO" }

in-exponential

gui.EASING_INOUTBACK: number & { readonly __brand: "gui.EASING_INOUTBACK" }

in-out-back

gui.EASING_INOUTBOUNCE: number & { readonly __brand: "gui.EASING_INOUTBOUNCE" }

in-out-bounce

gui.EASING_INOUTCIRC: number & { readonly __brand: "gui.EASING_INOUTCIRC" }

in-out-circlic

gui.EASING_INOUTCUBIC: number & { readonly __brand: "gui.EASING_INOUTCUBIC" }

in-out-cubic

gui.EASING_INOUTELASTIC: number & { readonly __brand: "gui.EASING_INOUTELASTIC" }

in-out-elastic

gui.EASING_INOUTEXPO: number & { readonly __brand: "gui.EASING_INOUTEXPO" }

in-out-exponential

gui.EASING_INOUTQUAD: number & { readonly __brand: "gui.EASING_INOUTQUAD" }

in-out-quadratic

gui.EASING_INOUTQUART: number & { readonly __brand: "gui.EASING_INOUTQUART" }

in-out-quartic

gui.EASING_INOUTQUINT: number & { readonly __brand: "gui.EASING_INOUTQUINT" }

in-out-quintic

gui.EASING_INOUTSINE: number & { readonly __brand: "gui.EASING_INOUTSINE" }

in-out-sine

gui.EASING_INQUAD: number & { readonly __brand: "gui.EASING_INQUAD" }

in-quadratic

gui.EASING_INQUART: number & { readonly __brand: "gui.EASING_INQUART" }

in-quartic

gui.EASING_INQUINT: number & { readonly __brand: "gui.EASING_INQUINT" }

in-quintic

gui.EASING_INSINE: number & { readonly __brand: "gui.EASING_INSINE" }

in-sine

gui.EASING_LINEAR: number & { readonly __brand: "gui.EASING_LINEAR" }

linear interpolation

gui.EASING_OUTBACK: number & { readonly __brand: "gui.EASING_OUTBACK" }

out-back

gui.EASING_OUTBOUNCE: number & { readonly __brand: "gui.EASING_OUTBOUNCE" }

out-bounce

gui.EASING_OUTCIRC: number & { readonly __brand: "gui.EASING_OUTCIRC" }

out-circlic

gui.EASING_OUTCUBIC: number & { readonly __brand: "gui.EASING_OUTCUBIC" }

out-cubic

gui.EASING_OUTELASTIC: number & { readonly __brand: "gui.EASING_OUTELASTIC" }

out-elastic

gui.EASING_OUTEXPO: number & { readonly __brand: "gui.EASING_OUTEXPO" }

out-exponential

gui.EASING_OUTINBACK: number & { readonly __brand: "gui.EASING_OUTINBACK" }

out-in-back

gui.EASING_OUTINBOUNCE: number & { readonly __brand: "gui.EASING_OUTINBOUNCE" }

out-in-bounce

gui.EASING_OUTINCIRC: number & { readonly __brand: "gui.EASING_OUTINCIRC" }

out-in-circlic

gui.EASING_OUTINCUBIC: number & { readonly __brand: "gui.EASING_OUTINCUBIC" }

out-in-cubic

gui.EASING_OUTINELASTIC: number & { readonly __brand: "gui.EASING_OUTINELASTIC" }

out-in-elastic

gui.EASING_OUTINEXPO: number & { readonly __brand: "gui.EASING_OUTINEXPO" }

out-in-exponential

gui.EASING_OUTINQUAD: number & { readonly __brand: "gui.EASING_OUTINQUAD" }

out-in-quadratic

gui.EASING_OUTINQUART: number & { readonly __brand: "gui.EASING_OUTINQUART" }

out-in-quartic

gui.EASING_OUTINQUINT: number & { readonly __brand: "gui.EASING_OUTINQUINT" }

out-in-quintic

gui.EASING_OUTINSINE: number & { readonly __brand: "gui.EASING_OUTINSINE" }

out-in-sine

gui.EASING_OUTQUAD: number & { readonly __brand: "gui.EASING_OUTQUAD" }

out-quadratic

gui.EASING_OUTQUART: number & { readonly __brand: "gui.EASING_OUTQUART" }

out-quartic

gui.EASING_OUTQUINT: number & { readonly __brand: "gui.EASING_OUTQUINT" }

out-quintic

gui.EASING_OUTSINE: number & { readonly __brand: "gui.EASING_OUTSINE" }

out-sine

gui.KEYBOARD_TYPE_DEFAULT: number & { readonly __brand: "gui.KEYBOARD_TYPE_DEFAULT" }

default keyboard

gui.KEYBOARD_TYPE_EMAIL: number & { readonly __brand: "gui.KEYBOARD_TYPE_EMAIL" }

email keyboard

gui.KEYBOARD_TYPE_NUMBER_PAD: number & { readonly __brand: "gui.KEYBOARD_TYPE_NUMBER_PAD" }

number input keyboard

gui.KEYBOARD_TYPE_PASSWORD: number & { readonly __brand: "gui.KEYBOARD_TYPE_PASSWORD" }

password keyboard

gui.PIEBOUNDS_ELLIPSE: number & { readonly __brand: "gui.PIEBOUNDS_ELLIPSE" }

elliptical pie node bounds

gui.PIEBOUNDS_RECTANGLE: number & { readonly __brand: "gui.PIEBOUNDS_RECTANGLE" }

rectangular pie node bounds

gui.PIVOT_CENTER: number & { readonly __brand: "gui.PIVOT_CENTER" }

center pivot

gui.PIVOT_E: number & { readonly __brand: "gui.PIVOT_E" }

east pivot

gui.PIVOT_N: number & { readonly __brand: "gui.PIVOT_N" }

north pivot

gui.PIVOT_NE: number & { readonly __brand: "gui.PIVOT_NE" }

north-east pivot

gui.PIVOT_NW: number & { readonly __brand: "gui.PIVOT_NW" }

north-west pivot

gui.PIVOT_S: number & { readonly __brand: "gui.PIVOT_S" }

south pivot

gui.PIVOT_SE: number & { readonly __brand: "gui.PIVOT_SE" }

south-east pivot

gui.PIVOT_SW: number & { readonly __brand: "gui.PIVOT_SW" }

south-west pivot

gui.PIVOT_W: number & { readonly __brand: "gui.PIVOT_W" }

west pivot

gui.PLAYBACK_LOOP_BACKWARD: number & { readonly __brand: "gui.PLAYBACK_LOOP_BACKWARD" }

loop backward

gui.PLAYBACK_LOOP_FORWARD: number & { readonly __brand: "gui.PLAYBACK_LOOP_FORWARD" }

loop forward

gui.PLAYBACK_LOOP_PINGPONG: number & { readonly __brand: "gui.PLAYBACK_LOOP_PINGPONG" }

ping pong loop

gui.PLAYBACK_ONCE_BACKWARD: number & { readonly __brand: "gui.PLAYBACK_ONCE_BACKWARD" }

once backward

gui.PLAYBACK_ONCE_FORWARD: number & { readonly __brand: "gui.PLAYBACK_ONCE_FORWARD" }

once forward

gui.PLAYBACK_ONCE_PINGPONG: number & { readonly __brand: "gui.PLAYBACK_ONCE_PINGPONG" }

once forward and then backward

gui.PROP_COLOR: string & { readonly __brand: "gui.PROP_COLOR" }

color property

gui.PROP_EULER: string & { readonly __brand: "gui.PROP_EULER" }

euler property

gui.PROP_FILL_ANGLE: string & { readonly __brand: "gui.PROP_FILL_ANGLE" }

fill_angle property

gui.PROP_INNER_RADIUS: string & { readonly __brand: "gui.PROP_INNER_RADIUS" }

inner_radius property

gui.PROP_LEADING: string & { readonly __brand: "gui.PROP_LEADING" }

leading property

gui.PROP_OUTLINE: string & { readonly __brand: "gui.PROP_OUTLINE" }

outline color property

gui.PROP_POSITION: string & { readonly __brand: "gui.PROP_POSITION" }

position property

gui.PROP_ROTATION: string & { readonly __brand: "gui.PROP_ROTATION" }

rotation property

gui.PROP_SCALE: string & { readonly __brand: "gui.PROP_SCALE" }

scale property

gui.PROP_SHADOW: string & { readonly __brand: "gui.PROP_SHADOW" }

shadow color property

gui.PROP_SIZE: string & { readonly __brand: "gui.PROP_SIZE" }

size property

gui.PROP_SLICE9: string & { readonly __brand: "gui.PROP_SLICE9" }

slice9 property

gui.PROP_TRACKING: string & { readonly __brand: "gui.PROP_TRACKING" }

tracking property

gui.RESULT_DATA_ERROR: number & { readonly __brand: "gui.RESULT_DATA_ERROR" }

data error The provided data is not in the expected format or is in some other way incorrect, for instance the image data provided to gui.new_texture().

gui.RESULT_OUT_OF_RESOURCES: number & { readonly __brand: "gui.RESULT_OUT_OF_RESOURCES" }

out of resource The system is out of resources, for instance when trying to create a new texture using gui.new_texture().

gui.RESULT_TEXTURE_ALREADY_EXISTS: number & { readonly __brand: "gui.RESULT_TEXTURE_ALREADY_EXISTS" }

texture already exists The texture id already exists when trying to use gui.new_texture().

gui.SAFE_AREA_BOTH: number & { readonly __brand: "gui.SAFE_AREA_BOTH" }

both sides safe area Safe area mode that applies insets on all edges.

gui.SAFE_AREA_LONG: number & { readonly __brand: "gui.SAFE_AREA_LONG" }

long side safe area Safe area mode that applies insets only on the long edges.

gui.SAFE_AREA_NONE: number & { readonly __brand: "gui.SAFE_AREA_NONE" }

no safe area Safe area mode that ignores safe area insets.

gui.SAFE_AREA_SHORT: number & { readonly __brand: "gui.SAFE_AREA_SHORT" }

short side safe area Safe area mode that applies insets only on the short edges.

gui.SIZE_MODE_AUTO: number & { readonly __brand: "gui.SIZE_MODE_AUTO" }

automatic size mode The size of the node is determined by the currently assigned texture.

gui.SIZE_MODE_MANUAL: number & { readonly __brand: "gui.SIZE_MODE_MANUAL" }

manual size mode The size of the node is determined by the size set in the editor, the constructor or by gui.set_size()

gui.TYPE_BOX: number & { readonly __brand: "gui.TYPE_BOX" }

box type

gui.TYPE_CUSTOM: number & { readonly __brand: "gui.TYPE_CUSTOM" }

custom type

gui.TYPE_PARTICLEFX: number & { readonly __brand: "gui.TYPE_PARTICLEFX" }

particlefx type

gui.TYPE_PIE: number & { readonly __brand: "gui.TYPE_PIE" }

pie type

gui.TYPE_TEXT: number & { readonly __brand: "gui.TYPE_TEXT" }

text type

Properties

fonts: Hash

The fonts used in the gui. The type of the property is hash. Key must be specified in options table.

material: Hash

The main material (the default material assigned to a GUI) used when rendering the gui. The type of the property is hash.

materials: Hash

The materials used when rendering the gui. The type of the property is hash. Key must be specified in options table.

textures: Hash

The textures used in the gui. The type of the property is hash. Key must be specified in options table.

Types

type gui.Adjust = typeof gui.ADJUST_FIT | typeof gui.ADJUST_STRETCH | typeof gui.ADJUST_ZOOM

type gui.Anchor = typeof gui.ANCHOR_BOTTOM | typeof gui.ANCHOR_LEFT | typeof gui.ANCHOR_NONE | typeof gui.ANCHOR_RIGHT | typeof gui.ANCHOR_TOP

type gui.Blend = typeof gui.BLEND_ADD | typeof gui.BLEND_ADD_ALPHA | typeof gui.BLEND_ALPHA | typeof gui.BLEND_MULT | typeof gui.BLEND_SCREEN

type gui.ClippingMode = typeof gui.CLIPPING_MODE_NONE | typeof gui.CLIPPING_MODE_STENCIL

type gui.Easing = typeof gui.EASING_INBACK | typeof gui.EASING_INBOUNCE | typeof gui.EASING_INCIRC | typeof gui.EASING_INCUBIC | typeof gui.EASING_INELASTIC | typeof gui.EASING_INEXPO | typeof gui.EASING_INOUTBACK | typeof gui.EASING_INOUTBOUNCE | typeof gui.EASING_INOUTCIRC | typeof gui.EASING_INOUTCUBIC | typeof gui.EASING_INOUTELASTIC | typeof gui.EASING_INOUTEXPO | typeof gui.EASING_INOUTQUAD | typeof gui.EASING_INOUTQUART | typeof gui.EASING_INOUTQUINT | typeof gui.EASING_INOUTSINE | typeof gui.EASING_INQUAD | typeof gui.EASING_INQUART | typeof gui.EASING_INQUINT | typeof gui.EASING_INSINE | typeof gui.EASING_LINEAR | typeof gui.EASING_OUTBACK | typeof gui.EASING_OUTBOUNCE | typeof gui.EASING_OUTCIRC | typeof gui.EASING_OUTCUBIC | typeof gui.EASING_OUTELASTIC | typeof gui.EASING_OUTEXPO | typeof gui.EASING_OUTINBACK | typeof gui.EASING_OUTINBOUNCE | typeof gui.EASING_OUTINCIRC | typeof gui.EASING_OUTINCUBIC | typeof gui.EASING_OUTINELASTIC | typeof gui.EASING_OUTINEXPO | typeof gui.EASING_OUTINQUAD | typeof gui.EASING_OUTINQUART | typeof gui.EASING_OUTINQUINT | typeof gui.EASING_OUTINSINE | typeof gui.EASING_OUTQUAD | typeof gui.EASING_OUTQUART | typeof gui.EASING_OUTQUINT | typeof gui.EASING_OUTSINE

type gui.KeyboardType = typeof gui.KEYBOARD_TYPE_DEFAULT | typeof gui.KEYBOARD_TYPE_EMAIL | typeof gui.KEYBOARD_TYPE_NUMBER_PAD | typeof gui.KEYBOARD_TYPE_PASSWORD

interface gui.LayoutObject { type: string; id: Hash; text_offset: number; text_length: number; x: number; y: number; width: number; height: number; attributes: LuaTable<string, string>; }

type gui.Node = Opaque<"node">

type gui.PieBounds = typeof gui.PIEBOUNDS_ELLIPSE | typeof gui.PIEBOUNDS_RECTANGLE

type gui.Pivot = typeof gui.PIVOT_CENTER | typeof gui.PIVOT_E | typeof gui.PIVOT_N | typeof gui.PIVOT_NE | typeof gui.PIVOT_NW | typeof gui.PIVOT_S | typeof gui.PIVOT_SE | typeof gui.PIVOT_SW | typeof gui.PIVOT_W

type gui.Playback = typeof gui.PLAYBACK_LOOP_BACKWARD | typeof gui.PLAYBACK_LOOP_FORWARD | typeof gui.PLAYBACK_LOOP_PINGPONG | typeof gui.PLAYBACK_ONCE_BACKWARD | typeof gui.PLAYBACK_ONCE_FORWARD | typeof gui.PLAYBACK_ONCE_PINGPONG

interface gui.PlayProperties { offset?: number; playback_rate?: number; }

type gui.Prop = typeof gui.PROP_COLOR | typeof gui.PROP_EULER | typeof gui.PROP_FILL_ANGLE | typeof gui.PROP_INNER_RADIUS | typeof gui.PROP_LEADING | typeof gui.PROP_OUTLINE | typeof gui.PROP_POSITION | typeof gui.PROP_ROTATION | typeof gui.PROP_SCALE | typeof gui.PROP_SHADOW | typeof gui.PROP_SIZE | typeof gui.PROP_SLICE9 | typeof gui.PROP_TRACKING

type gui.Result = typeof gui.RESULT_DATA_ERROR | typeof gui.RESULT_OUT_OF_RESOURCES | typeof gui.RESULT_TEXTURE_ALREADY_EXISTS

type gui.SafeArea = typeof gui.SAFE_AREA_BOTH | typeof gui.SAFE_AREA_LONG | typeof gui.SAFE_AREA_NONE | typeof gui.SAFE_AREA_SHORT

interface gui.SetOptions { index?: number; key?: string | Hash; }

type gui.SizeMode = typeof gui.SIZE_MODE_AUTO | typeof gui.SIZE_MODE_MANUAL

type gui.Type = typeof gui.TYPE_BOX | typeof gui.TYPE_CUSTOM | typeof gui.TYPE_PARTICLEFX | typeof gui.TYPE_PIE | typeof gui.TYPE_TEXT

On this page

Functionsgui.animate(4 overloads): voidgui.cancel_animations(node: Opaque<"node">, property?: keyof gui.NodeProperties | gui.Prop | Hash): voidgui.cancel_flipbook(node: Opaque<"node">): voidgui.clone(node: Opaque<"node">): Opaque<"node">gui.clone_tree(node: Opaque<"node"> | undefined): LuaTable<Hash, Opaque<"node">> & { get: LuaTableGetMethod<string, Opaque<"node">> }gui.delete_node(node: Opaque<"node">): voidgui.delete_texture(texture: string | Hash): voidgui.get(3 overloads)gui.get_adjust_mode(node: Opaque<"node">): gui.Adjustgui.get_alpha(node: Opaque<"node">): numbergui.get_blend_mode(node: Opaque<"node">): gui.Blendgui.get_clipping_inverted(node: Opaque<"node">): booleangui.get_clipping_mode(node: Opaque<"node">): gui.ClippingModegui.get_clipping_visible(node: Opaque<"node">): booleangui.get_color(node: Opaque<"node">): Vector4gui.get_euler(node: Opaque<"node">): Vector3gui.get_fill_angle(node: Opaque<"node">): numbergui.get_flipbook(node: Opaque<"node">): Hashgui.get_flipbook_cursor(node: Opaque<"node">): numbergui.get_flipbook_playback_rate(node: Opaque<"node">): numbergui.get_font(node: Opaque<"node">): Hashgui.get_font_resource(font_name: Hash | string): Hashgui.get_height(): numbergui.get_id(node: Opaque<"node">): Hashgui.get_index(node: Opaque<"node">): numbergui.get_inherit_alpha(node: Opaque<"node">): booleangui.get_inner_radius(node: Opaque<"node">): numbergui.get_layer(node: Opaque<"node">): Hashgui.get_layout(): Hashgui.get_layout_objects(node: Opaque<"node">): gui.LayoutObject[]Ngui.get_layouts(): LuaTable<Hash, Vector3>gui.get_leading(node: Opaque<"node">): numbergui.get_line_break(node: Opaque<"node">): booleangui.get_material(node: Opaque<"node">): Hashgui.get_node(id: string | Hash): Opaque<"node">gui.get_outer_bounds(node: Opaque<"node">): gui.PieBoundsgui.get_outline(node: Opaque<"node">): Vector4gui.get_parent(node: Opaque<"node">): Opaque<"node"> | undefinedgui.get_particlefx(node: Opaque<"node">): Hashgui.get_perimeter_vertices(node: Opaque<"node">): numbergui.get_pivot(node: Opaque<"node">): gui.Pivotgui.get_position(node: Opaque<"node">): Vector3gui.get_rotation(node: Opaque<"node">): Quaterniongui.get_scale(node: Opaque<"node">): Vector3gui.get_screen_position(node: Opaque<"node">): Vector3gui.get_shadow(node: Opaque<"node">): Vector4gui.get_size(node: Opaque<"node">): Vector3gui.get_size_mode(node: Opaque<"node">): gui.SizeModegui.get_slice9(node: Opaque<"node">): Vector4gui.get_text(node: Opaque<"node">): stringgui.get_texture(node: Opaque<"node">): Hashgui.get_tracking(node: Opaque<"node">): numbergui.get_tree(node: Opaque<"node"> | undefined): LuaTable<Hash, Opaque<"node">> & { get: LuaTableGetMethod<string, Opaque<"node">> }gui.get_type(node: Opaque<"node">): LuaMultiReturn<[gui.Type, number | undefined]>gui.get_visible(node: Opaque<"node">): booleangui.get_width(): numbergui.get_xanchor(node: Opaque<"node">): Exclude<gui.Anchor, typeof gui.ANCHOR_BOTTOM | typeof gui.ANCHOR_TOP>gui.get_yanchor(node: Opaque<"node">): Exclude<gui.Anchor, typeof gui.ANCHOR_LEFT | typeof gui.ANCHOR_RIGHT>gui.hide_keyboard(): voidgui.is_enabled(node: Opaque<"node">, recursive?: boolean): booleangui.move_above(node: Opaque<"node">, reference: Opaque<"node"> | undefined): voidgui.move_below(node: Opaque<"node">, reference: Opaque<"node"> | undefined): voidgui.new_box_node(pos: Vector3 | Vector4, size: Vector3): Opaque<"node">gui.new_particlefx_node(pos: Vector3 | Vector4, particlefx: Hash | string): Opaque<"node">gui.new_pie_node(pos: Vector3 | Vector4, size: Vector3): Opaque<"node">gui.new_text_node(pos: Vector3 | Vector4, text: string): Opaque<"node">gui.new_texture(2 overloads): LuaMultiReturn<[boolean, gui.Result | undefined]>Cgui.pick_node(node: Opaque<"node">, x: number, y: number): booleangui.play_flipbook(2 overloads): voidgui.play_particlefx(node: Opaque<"node">, emitter_state_function?: (self: unknown, node: Opaque<"node"> | undefined, emitter: Hash, state: particlefx.EmitterState) => void): voidgui.reset_keyboard(): voidgui.reset_material(node: Opaque<"node">): voidgui.reset_nodes(): voidgui.screen_to_local(node: Opaque<"node">, screen_position: Vector3 | Vector4): Vector3gui.set(6 overloads): voidCgui.set_adjust_mode(node: Opaque<"node">, adjust_mode: gui.Adjust): voidgui.set_alpha(node: Opaque<"node">, alpha: number): voidgui.set_blend_mode(node: Opaque<"node">, blend_mode: gui.Blend): voidgui.set_clipping_inverted(node: Opaque<"node">, inverted: boolean): voidgui.set_clipping_mode(node: Opaque<"node">, clipping_mode: gui.ClippingMode): voidgui.set_clipping_visible(node: Opaque<"node">, visible: boolean): voidgui.set_color(node: Opaque<"node">, color: Vector3 | Vector4): voidgui.set_enabled(node: Opaque<"node">, enabled: boolean): voidgui.set_euler(node: Opaque<"node">, rotation: Vector3 | Vector4): voidgui.set_fill_angle(node: Opaque<"node">, angle: number): voidgui.set_flipbook_cursor(node: Opaque<"node">, cursor: number): voidgui.set_flipbook_playback_rate(node: Opaque<"node">, playback_rate: number): voidgui.set_font(node: Opaque<"node">, font: string | Hash): voidgui.set_id(node: Opaque<"node">, id: string | Hash): voidgui.set_inherit_alpha(node: Opaque<"node">, inherit_alpha: boolean): voidgui.set_inner_radius(node: Opaque<"node">, radius: number): voidgui.set_layer(node: Opaque<"node">, layer: string | Hash): voidgui.set_layout(layout: string | Hash): booleangui.set_leading(node: Opaque<"node">, leading: number): voidgui.set_line_break(node: Opaque<"node">, line_break: boolean): voidgui.set_material(node: Opaque<"node">, material: string | Hash): voidgui.set_outer_bounds(node: Opaque<"node">, bounds_mode: gui.PieBounds): voidgui.set_outline(node: Opaque<"node">, color: Vector3 | Vector4): voidgui.set_parent(node: Opaque<"node">, parent: Opaque<"node"> | undefined, keep_scene_transform?: boolean): voidgui.set_particlefx(node: Opaque<"node">, particlefx: Hash | string): voidgui.set_perimeter_vertices(node: Opaque<"node">, vertices: number): voidgui.set_pivot(node: Opaque<"node">, pivot: gui.Pivot): voidgui.set_position(node: Opaque<"node">, position: Vector3 | Vector4): voidgui.set_render_order(order: number): voidgui.set_rotation(node: Opaque<"node">, rotation: Quaternion | Vector4 | Vector3): voidgui.set_safe_area_mode(mode: gui.SafeArea): voidgui.set_scale(node: Opaque<"node">, scale: Vector3 | Vector4): voidgui.set_screen_position(node: Opaque<"node">, screen_position: Vector3 | Vector4): voidgui.set_shadow(node: Opaque<"node">, color: Vector3 | Vector4): voidgui.set_size(node: Opaque<"node">, size: Vector3 | Vector4): voidgui.set_size_mode(node: Opaque<"node">, size_mode: gui.SizeMode): voidgui.set_slice9(node: Opaque<"node">, values: Vector4): voidgui.set_text(node: Opaque<"node">, text: string | number): voidgui.set_texture(node: Opaque<"node">, texture: string | Hash): voidgui.set_texture_data(2 overloads): booleanCgui.set_tracking(node: Opaque<"node">, tracking: number): voidgui.set_visible(node: Opaque<"node">, visible: boolean): voidgui.set_xanchor(node: Opaque<"node">, anchor: Exclude<gui.Anchor, typeof gui.ANCHOR_BOTTOM | typeof gui.ANCHOR_TOP>): voidgui.set_yanchor(node: Opaque<"node">, anchor: Exclude<gui.Anchor, typeof gui.ANCHOR_LEFT | typeof gui.ANCHOR_RIGHT>): voidgui.show_keyboard(type: gui.KeyboardType, autoclose: boolean): voidgui.stop_particlefx(2 overloads): voidConstantsgui.ADJUST_FIT: number & { readonly __brand: "gui.ADJUST_FIT" }gui.ADJUST_STRETCH: number & { readonly __brand: "gui.ADJUST_STRETCH" }gui.ADJUST_ZOOM: number & { readonly __brand: "gui.ADJUST_ZOOM" }gui.ANCHOR_BOTTOM: number & { readonly __brand: "gui.ANCHOR_BOTTOM" }gui.ANCHOR_LEFT: number & { readonly __brand: "gui.ANCHOR_LEFT" }gui.ANCHOR_NONE: number & { readonly __brand: "gui.ANCHOR_NONE" }gui.ANCHOR_RIGHT: number & { readonly __brand: "gui.ANCHOR_RIGHT" }gui.ANCHOR_TOP: number & { readonly __brand: "gui.ANCHOR_TOP" }gui.BLEND_ADD: number & { readonly __brand: "gui.BLEND_ADD" }gui.BLEND_ADD_ALPHA: number & { readonly __brand: "gui.BLEND_ADD_ALPHA" }gui.BLEND_ALPHA: number & { readonly __brand: "gui.BLEND_ALPHA" }gui.BLEND_MULT: number & { readonly __brand: "gui.BLEND_MULT" }gui.BLEND_SCREEN: number & { readonly __brand: "gui.BLEND_SCREEN" }gui.CLIPPING_MODE_NONE: number & { readonly __brand: "gui.CLIPPING_MODE_NONE" }gui.CLIPPING_MODE_STENCIL: number & { readonly __brand: "gui.CLIPPING_MODE_STENCIL" }gui.EASING_INBACK: number & { readonly __brand: "gui.EASING_INBACK" }gui.EASING_INBOUNCE: number & { readonly __brand: "gui.EASING_INBOUNCE" }gui.EASING_INCIRC: number & { readonly __brand: "gui.EASING_INCIRC" }gui.EASING_INCUBIC: number & { readonly __brand: "gui.EASING_INCUBIC" }gui.EASING_INELASTIC: number & { readonly __brand: "gui.EASING_INELASTIC" }gui.EASING_INEXPO: number & { readonly __brand: "gui.EASING_INEXPO" }gui.EASING_INOUTBACK: number & { readonly __brand: "gui.EASING_INOUTBACK" }gui.EASING_INOUTBOUNCE: number & { readonly __brand: "gui.EASING_INOUTBOUNCE" }gui.EASING_INOUTCIRC: number & { readonly __brand: "gui.EASING_INOUTCIRC" }gui.EASING_INOUTCUBIC: number & { readonly __brand: "gui.EASING_INOUTCUBIC" }gui.EASING_INOUTELASTIC: number & { readonly __brand: "gui.EASING_INOUTELASTIC" }gui.EASING_INOUTEXPO: number & { readonly __brand: "gui.EASING_INOUTEXPO" }gui.EASING_INOUTQUAD: number & { readonly __brand: "gui.EASING_INOUTQUAD" }gui.EASING_INOUTQUART: number & { readonly __brand: "gui.EASING_INOUTQUART" }gui.EASING_INOUTQUINT: number & { readonly __brand: "gui.EASING_INOUTQUINT" }gui.EASING_INOUTSINE: number & { readonly __brand: "gui.EASING_INOUTSINE" }gui.EASING_INQUAD: number & { readonly __brand: "gui.EASING_INQUAD" }gui.EASING_INQUART: number & { readonly __brand: "gui.EASING_INQUART" }gui.EASING_INQUINT: number & { readonly __brand: "gui.EASING_INQUINT" }gui.EASING_INSINE: number & { readonly __brand: "gui.EASING_INSINE" }gui.EASING_LINEAR: number & { readonly __brand: "gui.EASING_LINEAR" }gui.EASING_OUTBACK: number & { readonly __brand: "gui.EASING_OUTBACK" }gui.EASING_OUTBOUNCE: number & { readonly __brand: "gui.EASING_OUTBOUNCE" }gui.EASING_OUTCIRC: number & { readonly __brand: "gui.EASING_OUTCIRC" }gui.EASING_OUTCUBIC: number & { readonly __brand: "gui.EASING_OUTCUBIC" }gui.EASING_OUTELASTIC: number & { readonly __brand: "gui.EASING_OUTELASTIC" }gui.EASING_OUTEXPO: number & { readonly __brand: "gui.EASING_OUTEXPO" }gui.EASING_OUTINBACK: number & { readonly __brand: "gui.EASING_OUTINBACK" }gui.EASING_OUTINBOUNCE: number & { readonly __brand: "gui.EASING_OUTINBOUNCE" }gui.EASING_OUTINCIRC: number & { readonly __brand: "gui.EASING_OUTINCIRC" }gui.EASING_OUTINCUBIC: number & { readonly __brand: "gui.EASING_OUTINCUBIC" }gui.EASING_OUTINELASTIC: number & { readonly __brand: "gui.EASING_OUTINELASTIC" }gui.EASING_OUTINEXPO: number & { readonly __brand: "gui.EASING_OUTINEXPO" }gui.EASING_OUTINQUAD: number & { readonly __brand: "gui.EASING_OUTINQUAD" }gui.EASING_OUTINQUART: number & { readonly __brand: "gui.EASING_OUTINQUART" }gui.EASING_OUTINQUINT: number & { readonly __brand: "gui.EASING_OUTINQUINT" }gui.EASING_OUTINSINE: number & { readonly __brand: "gui.EASING_OUTINSINE" }gui.EASING_OUTQUAD: number & { readonly __brand: "gui.EASING_OUTQUAD" }gui.EASING_OUTQUART: number & { readonly __brand: "gui.EASING_OUTQUART" }gui.EASING_OUTQUINT: number & { readonly __brand: "gui.EASING_OUTQUINT" }gui.EASING_OUTSINE: number & { readonly __brand: "gui.EASING_OUTSINE" }gui.KEYBOARD_TYPE_DEFAULT: number & { readonly __brand: "gui.KEYBOARD_TYPE_DEFAULT" }gui.KEYBOARD_TYPE_EMAIL: number & { readonly __brand: "gui.KEYBOARD_TYPE_EMAIL" }gui.KEYBOARD_TYPE_NUMBER_PAD: number & { readonly __brand: "gui.KEYBOARD_TYPE_NUMBER_PAD" }gui.KEYBOARD_TYPE_PASSWORD: number & { readonly __brand: "gui.KEYBOARD_TYPE_PASSWORD" }gui.PIEBOUNDS_ELLIPSE: number & { readonly __brand: "gui.PIEBOUNDS_ELLIPSE" }gui.PIEBOUNDS_RECTANGLE: number & { readonly __brand: "gui.PIEBOUNDS_RECTANGLE" }gui.PIVOT_CENTER: number & { readonly __brand: "gui.PIVOT_CENTER" }gui.PIVOT_E: number & { readonly __brand: "gui.PIVOT_E" }gui.PIVOT_N: number & { readonly __brand: "gui.PIVOT_N" }gui.PIVOT_NE: number & { readonly __brand: "gui.PIVOT_NE" }gui.PIVOT_NW: number & { readonly __brand: "gui.PIVOT_NW" }gui.PIVOT_S: number & { readonly __brand: "gui.PIVOT_S" }gui.PIVOT_SE: number & { readonly __brand: "gui.PIVOT_SE" }gui.PIVOT_SW: number & { readonly __brand: "gui.PIVOT_SW" }gui.PIVOT_W: number & { readonly __brand: "gui.PIVOT_W" }gui.PLAYBACK_LOOP_BACKWARD: number & { readonly __brand: "gui.PLAYBACK_LOOP_BACKWARD" }gui.PLAYBACK_LOOP_FORWARD: number & { readonly __brand: "gui.PLAYBACK_LOOP_FORWARD" }gui.PLAYBACK_LOOP_PINGPONG: number & { readonly __brand: "gui.PLAYBACK_LOOP_PINGPONG" }gui.PLAYBACK_ONCE_BACKWARD: number & { readonly __brand: "gui.PLAYBACK_ONCE_BACKWARD" }gui.PLAYBACK_ONCE_FORWARD: number & { readonly __brand: "gui.PLAYBACK_ONCE_FORWARD" }gui.PLAYBACK_ONCE_PINGPONG: number & { readonly __brand: "gui.PLAYBACK_ONCE_PINGPONG" }gui.PROP_COLOR: string & { readonly __brand: "gui.PROP_COLOR" }gui.PROP_EULER: string & { readonly __brand: "gui.PROP_EULER" }gui.PROP_FILL_ANGLE: string & { readonly __brand: "gui.PROP_FILL_ANGLE" }gui.PROP_INNER_RADIUS: string & { readonly __brand: "gui.PROP_INNER_RADIUS" }gui.PROP_LEADING: string & { readonly __brand: "gui.PROP_LEADING" }gui.PROP_OUTLINE: string & { readonly __brand: "gui.PROP_OUTLINE" }gui.PROP_POSITION: string & { readonly __brand: "gui.PROP_POSITION" }gui.PROP_ROTATION: string & { readonly __brand: "gui.PROP_ROTATION" }gui.PROP_SCALE: string & { readonly __brand: "gui.PROP_SCALE" }gui.PROP_SHADOW: string & { readonly __brand: "gui.PROP_SHADOW" }gui.PROP_SIZE: string & { readonly __brand: "gui.PROP_SIZE" }gui.PROP_SLICE9: string & { readonly __brand: "gui.PROP_SLICE9" }gui.PROP_TRACKING: string & { readonly __brand: "gui.PROP_TRACKING" }gui.RESULT_DATA_ERROR: number & { readonly __brand: "gui.RESULT_DATA_ERROR" }gui.RESULT_OUT_OF_RESOURCES: number & { readonly __brand: "gui.RESULT_OUT_OF_RESOURCES" }gui.RESULT_TEXTURE_ALREADY_EXISTS: number & { readonly __brand: "gui.RESULT_TEXTURE_ALREADY_EXISTS" }gui.SAFE_AREA_BOTH: number & { readonly __brand: "gui.SAFE_AREA_BOTH" }gui.SAFE_AREA_LONG: number & { readonly __brand: "gui.SAFE_AREA_LONG" }gui.SAFE_AREA_NONE: number & { readonly __brand: "gui.SAFE_AREA_NONE" }gui.SAFE_AREA_SHORT: number & { readonly __brand: "gui.SAFE_AREA_SHORT" }gui.SIZE_MODE_AUTO: number & { readonly __brand: "gui.SIZE_MODE_AUTO" }gui.SIZE_MODE_MANUAL: number & { readonly __brand: "gui.SIZE_MODE_MANUAL" }gui.TYPE_BOX: number & { readonly __brand: "gui.TYPE_BOX" }gui.TYPE_CUSTOM: number & { readonly __brand: "gui.TYPE_CUSTOM" }gui.TYPE_PARTICLEFX: number & { readonly __brand: "gui.TYPE_PARTICLEFX" }gui.TYPE_PIE: number & { readonly __brand: "gui.TYPE_PIE" }gui.TYPE_TEXT: number & { readonly __brand: "gui.TYPE_TEXT" }Propertiesfonts: Hashmaterial: Hashmaterials: Hashtextures: HashTypestype gui.Adjust = typeof gui.ADJUST_FIT | typeof gui.ADJUST_STRETCH | typeof gui.ADJUST_ZOOMtype gui.Anchor = typeof gui.ANCHOR_BOTTOM | typeof gui.ANCHOR_LEFT | typeof gui.ANCHOR_NONE | typeof gui.ANCHOR_RIGHT | typeof gui.ANCHOR_TOPtype gui.Blend = typeof gui.BLEND_ADD | typeof gui.BLEND_ADD_ALPHA | typeof gui.BLEND_ALPHA | typeof gui.BLEND_MULT | typeof gui.BLEND_SCREENtype gui.ClippingMode = typeof gui.CLIPPING_MODE_NONE | typeof gui.CLIPPING_MODE_STENCILtype gui.Easing = typeof gui.EASING_INBACK | typeof gui.EASING_INBOUNCE | typeof gui.EASING_INCIRC | typeof gui.EASING_INCUBIC | typeof gui.EASING_INELASTIC | typeof gui.EASING_INEXPO | typeof gui.EASING_INOUTBACK | typeof gui.EASING_INOUTBOUNCE | typeof gui.EASING_INOUTCIRC | typeof gui.EASING_INOUTCUBIC | typeof gui.EASING_INOUTELASTIC | typeof gui.EASING_INOUTEXPO | typeof gui.EASING_INOUTQUAD | typeof gui.EASING_INOUTQUART | typeof gui.EASING_INOUTQUINT | typeof gui.EASING_INOUTSINE | typeof gui.EASING_INQUAD | typeof gui.EASING_INQUART | typeof gui.EASING_INQUINT | typeof gui.EASING_INSINE | typeof gui.EASING_LINEAR | typeof gui.EASING_OUTBACK | typeof gui.EASING_OUTBOUNCE | typeof gui.EASING_OUTCIRC | typeof gui.EASING_OUTCUBIC | typeof gui.EASING_OUTELASTIC | typeof gui.EASING_OUTEXPO | typeof gui.EASING_OUTINBACK | typeof gui.EASING_OUTINBOUNCE | typeof gui.EASING_OUTINCIRC | typeof gui.EASING_OUTINCUBIC | typeof gui.EASING_OUTINELASTIC | typeof gui.EASING_OUTINEXPO | typeof gui.EASING_OUTINQUAD | typeof gui.EASING_OUTINQUART | typeof gui.EASING_OUTINQUINT | typeof gui.EASING_OUTINSINE | typeof gui.EASING_OUTQUAD | typeof gui.EASING_OUTQUART | typeof gui.EASING_OUTQUINT | typeof gui.EASING_OUTSINEtype gui.KeyboardType = typeof gui.KEYBOARD_TYPE_DEFAULT | typeof gui.KEYBOARD_TYPE_EMAIL | typeof gui.KEYBOARD_TYPE_NUMBER_PAD | typeof gui.KEYBOARD_TYPE_PASSWORDinterface gui.LayoutObject { type: string; id: Hash; text_offset: number; text_length: number; x: number; y: number; width: number; height: number; attributes: LuaTable<string, string>; }type gui.Node = Opaque<"node">type gui.PieBounds = typeof gui.PIEBOUNDS_ELLIPSE | typeof gui.PIEBOUNDS_RECTANGLEtype gui.Pivot = typeof gui.PIVOT_CENTER | typeof gui.PIVOT_E | typeof gui.PIVOT_N | typeof gui.PIVOT_NE | typeof gui.PIVOT_NW | typeof gui.PIVOT_S | typeof gui.PIVOT_SE | typeof gui.PIVOT_SW | typeof gui.PIVOT_Wtype gui.Playback = typeof gui.PLAYBACK_LOOP_BACKWARD | typeof gui.PLAYBACK_LOOP_FORWARD | typeof gui.PLAYBACK_LOOP_PINGPONG | typeof gui.PLAYBACK_ONCE_BACKWARD | typeof gui.PLAYBACK_ONCE_FORWARD | typeof gui.PLAYBACK_ONCE_PINGPONGinterface gui.PlayProperties { offset?: number; playback_rate?: number; }type gui.Prop = typeof gui.PROP_COLOR | typeof gui.PROP_EULER | typeof gui.PROP_FILL_ANGLE | typeof gui.PROP_INNER_RADIUS | typeof gui.PROP_LEADING | typeof gui.PROP_OUTLINE | typeof gui.PROP_POSITION | typeof gui.PROP_ROTATION | typeof gui.PROP_SCALE | typeof gui.PROP_SHADOW | typeof gui.PROP_SIZE | typeof gui.PROP_SLICE9 | typeof gui.PROP_TRACKINGtype gui.Result = typeof gui.RESULT_DATA_ERROR | typeof gui.RESULT_OUT_OF_RESOURCES | typeof gui.RESULT_TEXTURE_ALREADY_EXISTStype gui.SafeArea = typeof gui.SAFE_AREA_BOTH | typeof gui.SAFE_AREA_LONG | typeof gui.SAFE_AREA_NONE | typeof gui.SAFE_AREA_SHORTinterface gui.SetOptions { index?: number; key?: string | Hash; }type gui.SizeMode = typeof gui.SIZE_MODE_AUTO | typeof gui.SIZE_MODE_MANUALtype gui.Type = typeof gui.TYPE_BOX | typeof gui.TYPE_CUSTOM | typeof gui.TYPE_PARTICLEFX | typeof gui.TYPE_PIE | typeof gui.TYPE_TEXT