Skip to main content
Branch: Release Candidate

TextLabel

Hierarchy

  • WorldObject
    • TextLabel

Index

Constructors

publicconstructor

  • new TextLabel(text: string, fontName: string, fontSize: number, scale: number, pos: IVector3, rot: IVector3, color: RGBA, outlineWidth: number, outlineColor: RGBA, useStreaming?: boolean, streamingDistance?: number): TextLabel
  • new TextLabel(text: string, fontName: string, fontSize: number, scale: number, pos: IVector3, rot: IVector3, color: RGBA, outlineWidth: number, outlineColor: RGBA, useStreaming?: boolean, streamingDistance?: number): TextLabel
  • Creates static text label without streaming enabled.

Properties

publicalign

align: TextLabelAlignment

publiccolor

color: RGBA

publicdimension

dimension: number

Object dimension.

Remarks

Check https://docs.altv.mp/articles/dimensions.html to understand how it works.

publicfaceCamera

faceCamera: boolean

publicfont

font: string

publicfontSize

fontSize: number

publicreadonlyid

id: number

publicreadonlyisGlobal

isGlobal: boolean

publicreadonlyisRemote

isRemote: boolean

Whether this entity was created clientside or serverside. (Clientside = false, Serverside = true).

publicreadonlyisStreamedIn

isStreamedIn: boolean

publicoutlineColor

outlineColor: RGBA

publicoutlineWidth

outlineWidth: number

publicpos

pos: Vector3

Object position

publicreadonlyrefCount

refCount: number

Returns the ref count of the entity.

Remarks

It’s only available in debug-mode.

publicreadonlyremoteID

remoteID: number

The serverside id of this entity.

publicrot

rot: Vector3

publicscale

scale: number

publicreadonlystreamingDistance

streamingDistance: number

publicreadonlytarget

target: Player

publictext

text: string

publicreadonlytype

type: BaseObjectType

Type of the object.

publicreadonlyvalid

valid: boolean

Object usability.

Returns

False if object is no longer usable.

publicvisible

visible: boolean

publicstaticreadonlyall

all: readonly TextLabel[]

Methods

publicdeleteMeta

  • deleteMeta(key: string): void
  • deleteMeta<K>(key: K): void

publicdestroy

  • destroy(): void
  • Removes the object from the world.

publicgetMeta

  • getMeta<K>(key: Exclude<K, never>): unknown
  • getMeta<K>(key: K): undefined | ICustomBaseObjectMeta[K]
  • getMeta<V>(key: string): undefined | V
  • Type parameters

    • K: string

publicgetMetaDataKeys

  • getMetaDataKeys(): readonly string[]

publicgetSyncedMeta

  • getSyncedMeta<K>(key: Exclude<K, never>): unknown
  • getSyncedMeta<K>(key: K): undefined | ICustomBaseObjectSyncedMeta[K]
  • getSyncedMeta<V>(key: string): undefined | V
  • Gets a value using the specified key.


    Type parameters

    • K: string

publicgetSyncedMetaKeys

  • getSyncedMetaKeys(): readonly string[]

publichasMeta

  • hasMeta(key: string): boolean
  • hasMeta<K>(key: K): boolean

publichasSyncedMeta

  • hasSyncedMeta(key: string): boolean
  • hasSyncedMeta<K>(key: K): boolean
  • Determines whether contains the specified key.

publicsetMeta

  • setMeta<K>(key: K, value: InterfaceValueByKey<ICustomBaseObjectMeta, K, unknown, void>): void
  • setMeta<K>(key: K, value: ICustomBaseObjectMeta[K]): void
  • setMeta<V, K>(key: K, value: InterfaceValueByKey<ICustomBaseObjectMeta, K, V, void>): void
  • Type parameters

    • K: string

publicstaticgetByID

  • getByID(id: number): null | TextLabel
  • Retrieves the marker from the pool.

publicstaticgetByRemoteID

  • getByRemoteID(type: BaseObjectType, id: number): null | BaseObject