Struct IPlayerTextLabel
This type represents a pointer to an unmanaged open.mp IPlayerTextLabel interface.
[OpenMpApi(new Type[] { typeof(ITextLabelBase) })]
public readonly struct IPlayerTextLabel : IEquatable<IPlayerTextLabel>, IPlayerTextLabel.IManagedInterface, ITextLabelBase.IManagedInterface, IExtensible.IManagedInterface, IEntity.IManagedInterface, IIDProvider.IManagedInterface, IUnmanagedInterface
- Implements
- Inherited Members
Constructors
IPlayerTextLabel(nint)
Initializes a new instance of the IPlayerTextLabel struct.
public IPlayerTextLabel(nint handle)
Parameters
handlenintA pointer to the unmanaged interface.
Properties
Handle
Gets the handle to the unmanaged interface instance.
public nint Handle { get; }
Property Value
HasValue
Gets a value indicating whether the pointer has a value.
public bool HasValue { get; }
Property Value
Methods
AddExtension<T>(T)
Adds the specified managed extension to this extensible.
public void AddExtension<T>(T extension) where T : Extension
Parameters
extensionTAn instance of the extension to add. The extension will be disposed if the extension could not be added to this extensible.
Type Parameters
TThe type of the managed extension.
Remarks
A managed extension can only be added to one extensible.
Exceptions
- ArgumentException
Throw when an instance of the extension type was already added to this extensible.
AttachToPlayer(IPlayer, Vector3)
Attaches the text label to a player.
public void AttachToPlayer(IPlayer player, Vector3 offset)
Parameters
playerIPlayerThe player to attach the text label to.
offsetVector3The offset from the player's position.
AttachToVehicle(IVehicle, Vector3)
Attaches the text label to a vehicle.
public void AttachToVehicle(IVehicle vehicle, Vector3 offset)
Parameters
vehicleIVehicleThe vehicle to attach the text label to.
offsetVector3The offset from the vehicle's position.
DetachFromPlayer(Vector3)
Detaches the text label from the player it was attached to.
public void DetachFromPlayer(Vector3 position)
Parameters
positionVector3The new position for the text label after detachment.
DetachFromVehicle(Vector3)
Detaches the text label from the vehicle it was attached to.
public void DetachFromVehicle(Vector3 position)
Parameters
positionVector3The new position for the text label after detachment.
Equals(IPlayerTextLabel)
public bool Equals(IPlayerTextLabel other)
Parameters
otherIPlayerTextLabel
Returns
Equals(object?)
public override bool Equals(object? other)
Parameters
otherobject
Returns
GetAttachmentData()
Gets the attachment data of the text label.
public ref TextLabelAttachmentData GetAttachmentData()
Returns
- TextLabelAttachmentData
A reference to the TextLabelAttachmentData structure containing the attachment information.
GetColour()
Gets the colour of the text label.
public Colour GetColour()
Returns
- Colour
The colour of the text label.
GetColour(out Colour)
Gets the colour of the text label.
public void GetColour(out Colour colour)
Parameters
colourColourWhen the method returns, contains the colour of the text label.
GetDrawDistance()
Gets the draw distance of the text label.
public float GetDrawDistance()
Returns
- float
The draw distance in units.
GetExtension(UID)
Gets the extension with the specified id.
public IExtension GetExtension(UID id)
Parameters
idUIDThe identifier of the extension type.
Returns
- IExtension
The extension or null if the extension could not be found.
GetExtension<T>()
Gets the specified managed extension from this extensible.
public T GetExtension<T>() where T : Extension
Returns
- T
An instance of the extension with type
T.
Type Parameters
TThe type of the managed extension.
Exceptions
- ArgumentException
Thrown if the extension could not be found.
GetHashCode()
public override int GetHashCode()
Returns
GetID()
Gets the identifier of this unit.
public int GetID()
Returns
- int
The identifier of the unit.
GetPosition()
Gets the position of this entity.
public Vector3 GetPosition()
Returns
- Vector3
The position of this entity.
GetRotation()
Gets the rotation of this entity.
public GTAQuat GetRotation()
Returns
- GTAQuat
The rotation of this entity.
GetTestLOS()
Gets whether line-of-sight testing is enabled for the text label.
public bool GetTestLOS()
Returns
- bool
trueif line-of-sight testing is enabled; otherwise,false.
GetText()
Gets the text content of the text label.
public string GetText()
Returns
- string
The text currently displayed on the text label.
GetVirtualWorld()
Gets the virtual world of this entity.
public int GetVirtualWorld()
Returns
- int
The virtual world of this entity.
QueryExtension<T>()
Gets the specified unmanaged extension from this extensible.
public T QueryExtension<T>() where T : unmanaged, IExtension.IManagedInterface
Returns
- T
The unmanaged extension or null if the extension could not be found.
Type Parameters
TThe type of the unmanaged extension.
RemoveExtension(IExtension)
Removes the specified extension from this extensible.
public void RemoveExtension(IExtension extension)
Parameters
extensionIExtensionThe extension to remove.
Exceptions
- ArgumentException
Thrown if the extension could not be found.
RemoveExtension(UID)
Removes the extension with the specified id from this extensible.
public void RemoveExtension(UID id)
Parameters
idUIDThe identifier of the extension.
Exceptions
- ArgumentException
Thrown if the extension could not be found.
RemoveExtension<T>(T)
Removes the specified managed extension from this extensible.
public void RemoveExtension<T>(T extension) where T : Extension
Parameters
extensionTThe managed extension to remove.
Type Parameters
TThe type of the managed extension.
Exceptions
- ArgumentException
Thrown if the extension could not be found.
SetColour(Colour)
Sets the colour of the text label.
public void SetColour(Colour colour)
Parameters
colourColourThe colour to set.
SetColourAndText(Colour, string)
Sets both the colour and text of the text label in a single operation.
public void SetColourAndText(Colour colour, string text)
Parameters
SetDrawDistance(float)
Sets the draw distance for the text label.
public void SetDrawDistance(float dist)
Parameters
distfloatThe draw distance in units.
SetPosition(Vector3)
Sets the position of this entity.
public void SetPosition(Vector3 position)
Parameters
positionVector3The position to set.
SetRotation(GTAQuat)
Sets the rotation of this entity.
public void SetRotation(GTAQuat rotation)
Parameters
rotationGTAQuatThe rotation to set.
SetTestLOS(bool)
Sets whether line-of-sight testing is enabled for the text label.
public void SetTestLOS(bool status)
Parameters
statusbooltrueto enable line-of-sight testing;falseto disable it.
SetText(string)
Sets the text content of the text label.
public void SetText(string text)
Parameters
textstringThe new text to display.
SetVirtualWorld(int)
Sets the virtual world of this entity.
public void SetVirtualWorld(int vw)
Parameters
vwintThe virtual world to set.
TryGetExtension<T>()
Tries to get the specified managed extension from this extensible.
public T? TryGetExtension<T>() where T : Extension
Returns
- T
An instance of the extension with type
Tor null if no extension with the specified type could be found.
Type Parameters
TThe type of the managed extension.
TryQueryExtension<T>(out T)
Tries to get the specified unmanaged extension from this extensible.
public bool TryQueryExtension<T>(out T extension) where T : unmanaged, IExtension.IManagedInterface
Parameters
extensionTThe extension if found, otherwise null.
Returns
Type Parameters
TThe type of the unmanaged extension.
Operators
operator ==(IPlayerTextLabel, object?)
Determines whether the specified values are equal.
public static bool operator ==(IPlayerTextLabel lhs, object? rhs)
Parameters
lhsIPlayerTextLabelThe value on the left side of the operator.
rhsobjectThe value on the right side of the operator.
Returns
- bool
trueif the values are equal; otherwise,false.
explicit operator IPlayerTextLabel(IEntity)
Casts the IEntity to a IPlayerTextLabel.
public static explicit operator IPlayerTextLabel(IEntity value)
Parameters
Returns
- IPlayerTextLabel
The converted IPlayerTextLabel.
explicit operator IPlayerTextLabel(IExtensible)
Casts the IExtensible to a IPlayerTextLabel.
public static explicit operator IPlayerTextLabel(IExtensible value)
Parameters
valueIExtensibleThe IExtensible to cast.
Returns
- IPlayerTextLabel
The converted IPlayerTextLabel.
explicit operator IPlayerTextLabel(IIDProvider)
Casts the IIDProvider to a IPlayerTextLabel.
public static explicit operator IPlayerTextLabel(IIDProvider value)
Parameters
valueIIDProviderThe IIDProvider to cast.
Returns
- IPlayerTextLabel
The converted IPlayerTextLabel.
explicit operator IEntity(IPlayerTextLabel)
Casts the IPlayerTextLabel to a IEntity.
public static explicit operator IEntity(IPlayerTextLabel value)
Parameters
valueIPlayerTextLabelThe IPlayerTextLabel to cast.
Returns
explicit operator IExtensible(IPlayerTextLabel)
Casts the IPlayerTextLabel to a IExtensible.
public static explicit operator IExtensible(IPlayerTextLabel value)
Parameters
valueIPlayerTextLabelThe IPlayerTextLabel to cast.
Returns
- IExtensible
The converted IExtensible.
explicit operator IIDProvider(IPlayerTextLabel)
Casts the IPlayerTextLabel to a IIDProvider.
public static explicit operator IIDProvider(IPlayerTextLabel value)
Parameters
valueIPlayerTextLabelThe IPlayerTextLabel to cast.
Returns
- IIDProvider
The converted IIDProvider.
explicit operator ITextLabelBase(IPlayerTextLabel)
Casts the IPlayerTextLabel to a ITextLabelBase.
public static explicit operator ITextLabelBase(IPlayerTextLabel value)
Parameters
valueIPlayerTextLabelThe IPlayerTextLabel to cast.
Returns
- ITextLabelBase
The converted ITextLabelBase.
explicit operator IPlayerTextLabel(ITextLabelBase)
Casts the ITextLabelBase to a IPlayerTextLabel.
public static explicit operator IPlayerTextLabel(ITextLabelBase value)
Parameters
valueITextLabelBaseThe ITextLabelBase to cast.
Returns
- IPlayerTextLabel
The converted IPlayerTextLabel.
operator !=(IPlayerTextLabel, object?)
Determines whether the specified values are not equal.
public static bool operator !=(IPlayerTextLabel lhs, object? rhs)
Parameters
lhsIPlayerTextLabelThe value on the left side of the operator.
rhsobjectThe value on the right side of the operator.
Returns
- bool
trueif the values are not equal; otherwise,false.