Table of Contents

Class TextLabel

Namespace
SampSharp.Entities.SAMP
Assembly
SampSharp.OpenMp.Entities.dll

Represents a component which provides the data and functionality of a 3D text label.

public class TextLabel : WorldEntity
Inheritance
TextLabel
Inherited Members

Constructors

TextLabel(IOmpEntityProvider, ITextLabelsComponent, ITextLabel)

Initializes a new instance of the TextLabel class.

protected TextLabel(IOmpEntityProvider entityProvider, ITextLabelsComponent textLabels, ITextLabel textLabel)

Parameters

entityProvider IOmpEntityProvider
textLabels ITextLabelsComponent
textLabel ITextLabel

Properties

AttachedEntity

Gets the entity this text label is attached to, if any.

public virtual Component? AttachedEntity { get; }

Property Value

Component

AttachedPlayer

Gets the Player this text label is attached to, or null if it is not attached to a player.

public virtual Player? AttachedPlayer { get; }

Property Value

Player

AttachedVehicle

Gets the Vehicle this text label is attached to, or null if it is not attached to a vehicle.

public virtual Vehicle? AttachedVehicle { get; }

Property Value

Vehicle

Color

Gets or sets the Color of this text label.

public virtual Color Color { get; set; }

Property Value

Color

DrawDistance

Gets the draw distance of this text label.

public virtual float DrawDistance { get; }

Property Value

float

IsOmpEntityDestroyed

Gets a value indicating whether the open.mp entity counterpart has been destroyed.

protected bool IsOmpEntityDestroyed { get; }

Property Value

bool

TestLos

Gets a value indicating whether line-of-sight testing is enabled for this text label.

public virtual bool TestLos { get; }

Property Value

bool

Text

Gets or sets the text displayed in this text label.

public virtual string Text { get; set; }

Property Value

string

Methods

Attach(Player, Vector3)

Attaches this text label to the specified player.

public virtual void Attach(Player player, Vector3 offset = default)

Parameters

player Player

The Player to attach this text label to.

offset Vector3

The offset position relative to the player as a Vector3.

Attach(Vehicle, Vector3)

Attaches this text label to the specified vehicle.

public virtual void Attach(Vehicle vehicle, Vector3 offset = default)

Parameters

vehicle Vehicle

The Vehicle to attach this text label to.

offset Vector3

The offset position relative to the vehicle as a Vector3.

DetachFromPlayer(Vector3)

Detaches this text label from the player it was attached to and places it at position.

public virtual void DetachFromPlayer(Vector3 position)

Parameters

position Vector3

The new world position.

DetachFromVehicle(Vector3)

Detaches this text label from the vehicle it was attached to and places it at position.

public virtual void DetachFromVehicle(Vector3 position)

Parameters

position Vector3

The new world position.

IsStreamedInForPlayer(Player)

Checks whether this text label is streamed in for the specified player.

public virtual bool IsStreamedInForPlayer(Player player)

Parameters

player Player

The player.

Returns

bool

true if streamed in; otherwise false.

OnDestroyComponent()

This method is invoked before this component is destroyed and removed from its entity.

protected override void OnDestroyComponent()

SetColorAndText(Color, string)

Updates the color and text of this text label in a single operation.

public virtual void SetColorAndText(Color color, string text)

Parameters

color Color

The new color.

text string

The new text.

StreamInForPlayer(Player)

Streams this text label in for the specified player.

public virtual void StreamInForPlayer(Player player)

Parameters

player Player

The player.

StreamOutForPlayer(Player)

Streams this text label out for the specified player.

public virtual void StreamOutForPlayer(Player player)

Parameters

player Player

The player.

ToString()

public override string ToString()

Returns

string

Operators

implicit operator ITextLabel(TextLabel?)

Performs an implicit conversion from TextLabel to ITextLabel.

public static implicit operator ITextLabel(TextLabel? textLabel)

Parameters

textLabel TextLabel

Returns

ITextLabel