Skip to content
On this page

Athena.controllers.textlabel

Modules

Functions

addToPlayer

Usage

Athena.controllers.textlabel.addToPlayer(player, textLabel): string

Add a local text label to player.

Example

ts
const uid = Athena.controllers.textLabel.addToPlayer(somePlayer, { text: 'Hello World!', pos: { x: 0, y: 0, z: 0 }});

Athena.controllers.textLabel.addToPlayer(somePlayer, { uid: 'uid-you-specify', text: 'Hello World!', pos: { x: 0, y: 0, z: 0 }});

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
textLabelTextLabel

Returns

string

uid A unique string for removal

Defined in

server/controllers/textlabel.ts:190


append

Usage

Athena.controllers.textlabel.append(label): string

Adds a text label to the global streamer.

Returns a uid or generates one if not specified.

Example

ts
const uid = Athena.controllers.textLabel.append({ text: 'Hello World!', pos: { x: 0, y: 0, z: 0 }});

Athena.controllers.textLabel.append({ uid: 'uid-you-specify', text: 'Hello World!', pos: { x: 0, y: 0, z: 0 }});

Parameters

NameType
labelTextLabel

Returns

string

uid A unique string for removal

Defined in

server/controllers/textlabel.ts:58


override

Usage

Athena.controllers.textlabel.override(functionName, callback): any

Used to override any text label streamer functionality

Parameters

NameType
functionName"append"
callback(label: TextLabel) => string

Returns

any

Defined in

server/controllers/textlabel.ts:216

Usage

Athena.controllers.textlabel.override(functionName, callback): any

Used to override any text label streamer functionality

Parameters

NameType
functionName"remove"
callback(uid: string) => boolean

Returns

any

Defined in

server/controllers/textlabel.ts:217

Usage

Athena.controllers.textlabel.override(functionName, callback): any

Used to override any text label streamer functionality

Parameters

NameType
functionName"addToPlayer"
callback(player: Player, textLabel: TextLabel) => string

Returns

any

Defined in

server/controllers/textlabel.ts:218

Usage

Athena.controllers.textlabel.override(functionName, callback): any

Used to override any text label streamer functionality

Parameters

NameType
functionName"removeFromPlayer"
callback(player: Player, uid: string) => any

Returns

any

Defined in

server/controllers/textlabel.ts:219

Usage

Athena.controllers.textlabel.override(functionName, callback): any

Used to override any text label streamer functionality

Parameters

NameType
functionName"update"
callback(uid: string, label: Partial<TextLabel>, player?: Player) => boolean

Returns

any

Defined in

server/controllers/textlabel.ts:220


remove

Usage

Athena.controllers.textlabel.remove(uid): boolean

Removes a text label based on uid from the global streamer

Example

ts
Athena.controllers.textLabel.remove(someUid);

Athena.controllers.textLabel.remove('uid-you-specify');

Parameters

NameTypeDescription
uidstringA unique string

Returns

boolean

Defined in

server/controllers/textlabel.ts:136


removeFromPlayer

Usage

Athena.controllers.textlabel.removeFromPlayer(player, uid): any

Remove a local text label from a player.

Example

ts
Athena.controllers.textLabel.removeFromPlayer(somePlayer, someUid);

Athena.controllers.textLabel.removeFromPlayer(somePlayer, 'uid-you-specify');

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
uidstringA unique string

Returns

any

Defined in

server/controllers/textlabel.ts:164


update

Usage

Athena.controllers.textlabel.update(uid, label, player?): boolean

Update a text label globally, or for a player.

Not defining the player tries to update the label globally.

Try not to perfrom this updates in an everyTick, and only update text labels.

Specify player as the last parameter to update their instance; otherwise updates all players if uid matches.

Example

ts
Athena.controllers.textLabel.update(someUid, { text: 'Hello World!' });

Athena.controllers.textLabel.update('uid-you-specify', { text: 'Hello World!' });

Athena.controllers.textLabel.update('uid-you-specify', { text: 'Hello World!' }, somePlayer);

Parameters

NameTypeDefault valueDescription
uidstringundefinedA unique string
labelPartial<TextLabel>undefined-
player?Playerundefined

Returns

boolean

Defined in

server/controllers/textlabel.ts:101

Created by Stuyk | Est. 2020