Athena.controllers.textlabel ​
Modules ​
Functions ​
addToPlayer ​
Usage
Athena.controllers.textlabel.addToPlayer(player
, textLabel
): string
Add a local text label to player.
Example ​
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 ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
textLabel | TextLabel |
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 ​
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 ​
Name | Type |
---|---|
label | TextLabel |
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 ​
Name | Type |
---|---|
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 ​
Name | Type |
---|---|
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 ​
Name | Type |
---|---|
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 ​
Name | Type |
---|---|
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 ​
Name | Type |
---|---|
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 ​
Athena.controllers.textLabel.remove(someUid);
Athena.controllers.textLabel.remove('uid-you-specify');
Parameters ​
Name | Type | Description |
---|---|---|
uid | string | A 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 ​
Athena.controllers.textLabel.removeFromPlayer(somePlayer, someUid);
Athena.controllers.textLabel.removeFromPlayer(somePlayer, 'uid-you-specify');
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
uid | string | A 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 ​
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 ​
Name | Type | Default value | Description |
---|---|---|---|
uid | string | undefined | A unique string |
label | Partial <TextLabel > | undefined | - |
player? | Player | undefined |
Returns ​
boolean