Skip to content

Global Functions

rech edited this page Jun 15, 2026 · 1 revision

Description

Functions accessible anywhere within a lua script.

Remarks

A few functions are shared with macros, so that's why they seem a bit redundant.


addScenecontrol(name, arguments, definition)

Description

Define a custom scenecontrol type.

Parameters

Name Type Description
name string The scenecontrol type's name
arguments number / Table (of string) / nil If number: represent the number of arguments of this scenecontrol type. If table, lists the name of each arguments of this scenecontrol type. If nil, the type has no arguments.
definition function A function with a scenecontrol command as an input that defines the behaviour of this scenecontrol type

Return types

nil

Remarks

name must not be the same as any other scenecontrol type's name already defined beforehand.

Examples

addScenecontrol("myType", 3, function(cmd)
    log(cmd.timing)
    log(cmd.args[1])
    log(cmd.args[2])
    log(cmd.args[3])
end)
addScenecontrol("myType", {"myArg1", "myArg2"}, function(cmd)
    log(cmd.timing)
    log(cmd.args[1])
    log(cmd.args[2])
end)
addScenecontrol("myType", nil, function(cmd)
    log(cmd.timing)
end)

log(object)

Description

Writing to the log file.

Parameters

Name Type Description
object any Object to be logged

Return types

nil

Remarks

The result can be viewed by pressing the "Error Log" button on the left side of the screen.

Example

log("Hello, world!")
log(616)
log(Channel.keyframe())

notify(object)

Description

Displaying a toast notification.

Parameters

Name Type Description
object any Object to be displayed

Return types

nil

Remarks

_

Example

notify("Hello, world!")
notify(616)
notify(Channel.keyframe())

notifyWarn(object)

Description

Displaying a warning toast notification.

Parameters

Name Type Description
object any Object to be displayed

Return types

nil

Remarks

_

Example

notifyWarn("Warning!")

notifyError(object)

Description

Displaying an error toast notification.

Parameters

Name Type Description
object any Object to be displayed

Return types

nil

Remarks

_

Example

notifyError("Error!")

xy(x, y)

Description

Create a XY object.

Parameters

Name Type Description
x number The x component
y number The y component

Return types

XY

Remarks

_

Example

local coordinate = xy(1, 2)

xyz(x, y, z)

Description

Create a XYZ object.

Parameters

Name Type Description
x number The x component
y number The y component
z number The z component

Return types

XYZ

Remarks

_

Example

local coordinate = xyz(1, 2, 3)

rgba(r, g, b, a)

Description

Create an RGBA object.

Parameters

Name Type Description
r number The red value (0-255)
g number The green value (0-255)
b number The blue value (0-255)
a number The alpha value (0-255)

Return types

RGBA

Remarks

_

Example

local whiteColor = rgba(255, 255, 255, 255)

hsva(h, s, v, a)

Description

Create an HSVA object.

Parameters

Name Type Description
h number The hue value (0-360)
s number The saturation value (0-1)
v number The brightness value (0-1)
a number The alpha value (0-1)

Return types

HSVA

Remarks

_

Example

local color = hsva(180, 1, 1, 1)

toNumber(s)

Description

Convert a string to a number.

Parameters

Name Type Description
s string The string to convert to number

Return types

number

Remarks

_

Example

local num = toNumber("100")

toBool(s)

Description

Convert a string to a boolean value.

Parameters

Name Type Description
s string The string to convert to boolean

Return types

boolean

Remarks

_

Example

local val = toBool("true")

Clone this wiki locally