Class TextLabel
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
entityProviderIOmpEntityProvidertextLabelsITextLabelsComponenttextLabelITextLabel
Properties
AttachedEntity
Gets the entity this text label is attached to, if any.
public virtual Component? AttachedEntity { get; }
Property Value
AttachedPlayer
public virtual Player? AttachedPlayer { get; }
Property Value
AttachedVehicle
public virtual Vehicle? AttachedVehicle { get; }
Property Value
Color
Gets or sets the Color of this text label.
public virtual Color Color { get; set; }
Property Value
DrawDistance
Gets the draw distance of this text label.
public virtual float DrawDistance { get; }
Property Value
IsOmpEntityDestroyed
Gets a value indicating whether the open.mp entity counterpart has been destroyed.
protected bool IsOmpEntityDestroyed { get; }
Property Value
TestLos
Gets a value indicating whether line-of-sight testing is enabled for this text label.
public virtual bool TestLos { get; }
Property Value
Text
Gets or sets the text displayed in this text label.
public virtual string Text { get; set; }
Property Value
Methods
Attach(Player, Vector3)
Attaches this text label to the specified player.
public virtual void Attach(Player player, Vector3 offset = default)
Parameters
playerPlayerThe Player to attach this text label to.
offsetVector3The 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
vehicleVehicleThe Vehicle to attach this text label to.
offsetVector3The 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
positionVector3The 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
positionVector3The new world position.
IsStreamedInForPlayer(Player)
Checks whether this text label is streamed in for the specified player.
public virtual bool IsStreamedInForPlayer(Player player)
Parameters
playerPlayerThe player.
Returns
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
StreamInForPlayer(Player)
Streams this text label in for the specified player.
public virtual void StreamInForPlayer(Player player)
Parameters
playerPlayerThe player.
StreamOutForPlayer(Player)
Streams this text label out for the specified player.
public virtual void StreamOutForPlayer(Player player)
Parameters
playerPlayerThe player.
ToString()
public override string ToString()
Returns
Operators
implicit operator ITextLabel(TextLabel?)
Performs an implicit conversion from TextLabel to ITextLabel.
public static implicit operator ITextLabel(TextLabel? textLabel)
Parameters
textLabelTextLabel