Class PlayerTextLabel
Represents a component which provides the data and functionality of a per-player 3D text label.
public class PlayerTextLabel : WorldEntity
- Inheritance
-
PlayerTextLabel
- Inherited Members
Constructors
PlayerTextLabel(IOmpEntityProvider, IPlayerTextLabelData, IPlayerTextLabel)
Initializes a new instance of the PlayerTextLabel class.
protected PlayerTextLabel(IOmpEntityProvider entityProvider, IPlayerTextLabelData playerTextLabels, IPlayerTextLabel playerTextLabel)
Parameters
entityProviderIOmpEntityProviderplayerTextLabelsIPlayerTextLabelDataplayerTextLabelIPlayerTextLabel
Properties
AttachedEntity
Gets the entity this player 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 the Color of this player text label.
public virtual Color Color { get; }
Property Value
DrawDistance
Gets the draw distance of this player 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 player text label.
public virtual bool TestLos { get; }
Property Value
Text
Gets the text displayed in this player text label.
public virtual string Text { get; }
Property Value
Methods
Attach(Player, Vector3)
Attaches this player text label to the specified player.
public virtual void Attach(Player player, Vector3 offset = default)
Parameters
playerPlayerThe Player to attach this player text label to.
offsetVector3The offset position relative to the player as a Vector3.
Attach(Vehicle, Vector3)
Attaches this player text label to the specified vehicle.
public virtual void Attach(Vehicle vehicle, Vector3 offset = default)
Parameters
vehicleVehicleThe Vehicle to attach this player text label to.
offsetVector3The offset position relative to the vehicle as a Vector3.
DetachFromPlayer(Vector3)
Detaches this player 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 player 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.
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 player text label in a single operation.
public virtual void SetColorAndText(Color color, string text)
Parameters
ToString()
public override string ToString()
Returns
Operators
implicit operator IPlayerTextLabel(PlayerTextLabel?)
Performs an implicit conversion from PlayerTextLabel to IPlayerTextLabel.
public static implicit operator IPlayerTextLabel(PlayerTextLabel? playerTextLabel)
Parameters
playerTextLabelPlayerTextLabel