Struct IPlayerTextLabelData
This type represents a pointer to an unmanaged open.mp IPlayerTextLabelData interface.
[OpenMpApi(new Type[] { typeof(IExtension), typeof(IPool<IPlayerTextLabel>) })]
public readonly struct IPlayerTextLabelData : IEquatable<IPlayerTextLabelData>, IPlayerTextLabelData.IManagedInterface, IExtension.IManagedInterface, IPool<IPlayerTextLabel>.IManagedInterface, IUnmanagedInterface
- Implements
- Inherited Members
Constructors
IPlayerTextLabelData(nint)
Initializes a new instance of the IPlayerTextLabelData struct.
public IPlayerTextLabelData(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
AsPool()
Gets the pool interface for managing per-player text labels.
public IPool<IPlayerTextLabel> AsPool()
Returns
- IPool<IPlayerTextLabel>
A pool interface for per-player text labels.
Bounds()
Gets the bounds of the pool.
public (Size, Size) Bounds()
Returns
Count()
Gets the number of elements in the pool.
public Size Count()
Returns
- Size
The number of elements in the pool.
Create(string, Colour, Vector3, float, bool)
Creates a new per-player text label.
public IPlayerTextLabel Create(string text, Colour colour, Vector3 pos, float drawDist, bool los)
Parameters
textstringThe text to display on the label.
colourColourThe colour of the text label.
posVector3The position where the text label will be created.
drawDistfloatThe draw distance of the text label.
losboolWhether line-of-sight testing is enabled.
Returns
- IPlayerTextLabel
The created per-player text label, or
nullif creation failed.
Create(string, Colour, Vector3, float, bool, IPlayer)
Creates a new per-player text label attached to a player.
[OpenMpApiOverload("_player")]
public IPlayerTextLabel Create(string text, Colour colour, Vector3 pos, float drawDist, bool los, IPlayer attach)
Parameters
textstringThe text to display on the label.
colourColourThe colour of the text label.
posVector3The position offset from the player.
drawDistfloatThe draw distance of the text label.
losboolWhether line-of-sight testing is enabled.
attachIPlayerThe player to attach the text label to.
Returns
- IPlayerTextLabel
The created per-player text label, or
nullif creation failed.
Create(string, Colour, Vector3, float, bool, IVehicle)
Creates a new per-player text label attached to a vehicle.
[OpenMpApiOverload("_vehicle")]
public IPlayerTextLabel Create(string text, Colour colour, Vector3 pos, float drawDist, bool los, IVehicle attach)
Parameters
textstringThe text to display on the label.
colourColourThe colour of the text label.
posVector3The position offset from the vehicle.
drawDistfloatThe draw distance of the text label.
losboolWhether line-of-sight testing is enabled.
attachIVehicleThe vehicle to attach the text label to.
Returns
- IPlayerTextLabel
The created per-player text label, or
nullif creation failed.
Equals(IPlayerTextLabelData)
public bool Equals(IPlayerTextLabelData other)
Parameters
otherIPlayerTextLabelData
Returns
Equals(object?)
public override bool Equals(object? other)
Parameters
otherobject
Returns
Get(int)
Gets the element at the specified index.
public IPlayerTextLabel Get(int index)
Parameters
indexintThe index of the element to retrieve.
Returns
- IPlayerTextLabel
The element at the specified index.
GetEnumerator()
Gets an enumerator that iterates through the pool.
public IPool<IPlayerTextLabel>.Enumerator GetEnumerator()
Returns
- IPool<IPlayerTextLabel>.Enumerator
An enumerator for the pool.
GetHashCode()
public override int GetHashCode()
Returns
GetPoolEventDispatcher()
Gets the event dispatcher for the pool.
public IEventDispatcher<IPoolEventHandler<IPlayerTextLabel>> GetPoolEventDispatcher()
Returns
- IEventDispatcher<IPoolEventHandler<IPlayerTextLabel>>
An IEventDispatcher<T> for handling pool events.
Lock(int)
Locks the element at the specified index.
public void Lock(int index)
Parameters
indexintThe index of the element to lock.
Release(int)
Releases the element at the specified index.
public void Release(int index)
Parameters
indexintThe index of the element to release.
Unlock(int)
Unlocks the element at the specified index.
public bool Unlock(int index)
Parameters
indexintThe index of the element to unlock.
Returns
Operators
operator ==(IPlayerTextLabelData, object?)
Determines whether the specified values are equal.
public static bool operator ==(IPlayerTextLabelData lhs, object? rhs)
Parameters
lhsIPlayerTextLabelDataThe 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 IPlayerTextLabelData(IExtension)
Casts the IExtension to a IPlayerTextLabelData.
public static explicit operator IPlayerTextLabelData(IExtension value)
Parameters
valueIExtensionThe IExtension to cast.
Returns
- IPlayerTextLabelData
The converted IPlayerTextLabelData.
explicit operator IExtension(IPlayerTextLabelData)
Casts the IPlayerTextLabelData to a IExtension.
public static explicit operator IExtension(IPlayerTextLabelData value)
Parameters
valueIPlayerTextLabelDataThe IPlayerTextLabelData to cast.
Returns
- IExtension
The converted IExtension.
explicit operator IPool<IPlayerTextLabel>(IPlayerTextLabelData)
Casts the IPlayerTextLabelData to a IPool<T>.
public static explicit operator IPool<IPlayerTextLabel>(IPlayerTextLabelData value)
Parameters
valueIPlayerTextLabelDataThe IPlayerTextLabelData to cast.
Returns
- IPool<IPlayerTextLabel>
The converted IPool<T>.
explicit operator IPlayerTextLabelData(IPool<IPlayerTextLabel>)
Casts the IPool<T> to a IPlayerTextLabelData.
public static explicit operator IPlayerTextLabelData(IPool<IPlayerTextLabel> value)
Parameters
valueIPool<IPlayerTextLabel>The IPool<T> to cast.
Returns
- IPlayerTextLabelData
The converted IPlayerTextLabelData.
operator !=(IPlayerTextLabelData, object?)
Determines whether the specified values are not equal.
public static bool operator !=(IPlayerTextLabelData lhs, object? rhs)
Parameters
lhsIPlayerTextLabelDataThe 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.
Explicit Interface Implementations
ExtensionId
Gets the identifier of the extension type. IPool<T>
static UID ExtensionId { get; }