Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TextLabel

Hierarchy

Index

Constructors

constructor

  • 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.

    Parameters

    • text: string
    • fontName: string
    • fontSize: number
    • scale: number
    • pos: IVector3
    • rot: IVector3
    • color: RGBA
    • outlineWidth: number
    • outlineColor: RGBA
    • Optional useStreaming: boolean
    • Optional streamingDistance: number

    Returns TextLabel

  • Creates text label with streaming enabled.

    Parameters

    • text: string
    • fontName: string
    • fontSize: number
    • scale: number
    • pos: IVector3
    • rot: IVector3
    • color: RGBA
    • outlineWidth: number
    • outlineColor: RGBA
    • Optional useStreaming: boolean
    • Optional streamingDistance: number

    Returns TextLabel

Properties

align

color

color: RGBA

dimension

dimension: number

Object dimension.

remarks

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

faceCamera

faceCamera: boolean

font

font: string

fontSize

fontSize: number

Readonly id

id: number

Readonly isGlobal

isGlobal: boolean

Readonly isRemote

isRemote: boolean

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

Readonly isStreamedIn

isStreamedIn: boolean

outlineColor

outlineColor: RGBA

outlineWidth

outlineWidth: number

pos

pos: Vector3

Object position

Readonly refCount

refCount: number

Returns the ref count of the entity.

remarks

It's only available in debug-mode.

Readonly remoteID

remoteID: number

The serverside id of this entity.

rot

rot: Vector3

scale

scale: number

Readonly streamingDistance

streamingDistance: number

Readonly target

target: Player

text

text: string

Readonly type

Type of the object.

Readonly valid

valid: boolean

Object usability.

returns

False if object is no longer usable.

visible

visible: boolean

Static Readonly all

all: readonly TextLabel[]

Methods

deleteMeta

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

destroy

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

    Returns void

getMeta

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

getMetaDataKeys

  • getMetaDataKeys(): readonly string[]

getSyncedMeta

  • getSyncedMeta<K>(key: Exclude<K, keyof ICustomBaseObjectSyncedMeta>): unknown
  • getSyncedMeta<K>(key: K): ICustomBaseObjectSyncedMeta[K] | undefined
  • getSyncedMeta<V>(key: string): V | undefined

getSyncedMetaKeys

  • getSyncedMetaKeys(): readonly string[]

hasMeta

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

hasSyncedMeta

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

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    True if the meta table contains any data at the specified key or False if not

  • Type parameters

    Parameters

    • key: K

    Returns boolean

setMeta

  • setMeta<K>(key: K, value: shared.InterfaceValueByKey<ICustomBaseObjectMeta, K>): void
  • setMeta<K>(key: K, value: ICustomBaseObjectMeta[K]): void
  • setMeta<V, K>(key: K, value: shared.InterfaceValueByKey<ICustomBaseObjectMeta, K, V>): void

Static getByID

  • Retrieves the marker from the pool.

    Parameters

    • id: number

      The id of the marker.

    Returns TextLabel | null

    Entity if it was found, otherwise null.

Static getByRemoteID