Skip to content

TextChannel

rech edited this page Jun 15, 2026 · 1 revision

Description

Class for creating text channels.

Remarks

A text channel returns a string value for any given timing. It is used for text controller content that can change over time.

Methods


create()

Description

Creates an empty keyframe text channel.

Parameters

_

Return types

KeyTextChannel

Remarks

Returns a keyframe text channel that can have keys added to it.

Example

local textChannel = TextChannel.create()
textChannel.addKey(0, "Hello")
textChannel.addKey(1000, "World")

constant(val)

Description

Creates a constant text channel.

Parameters

Name Type Description
val string The constant text value

Return types

TextChannel

Remarks

_

Example

local text = TextChannel.constant("Hello, world!")

fromValue(channel, maxLength = 10, precision = 0)

Description

Creates a text channel that displays the value of a ValueChannel as text.

Parameters

Name Type Description
channel ValueChannel The value channel to display
maxLength number Maximum length of the resulting text
precision number Number of decimal places to display

Return types

TextChannel

Remarks

Beware of floating point precision.

Example

local scoreText = TextChannel.fromValue(Context.currentScore, 8, 0)

Clone this wiki locally