Table of Contents

Struct IPlayerTextLabel

Namespace
SampSharp.OpenMp.Core.Api
Assembly
SampSharp.OpenMp.Core.dll

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

handle nint

A pointer to the unmanaged interface.

Properties

Handle

Gets the handle to the unmanaged interface instance.

public nint Handle { get; }

Property Value

nint

HasValue

Gets a value indicating whether the pointer has a value.

public bool HasValue { get; }

Property Value

bool

Methods

AddExtension<T>(T)

Adds the specified managed extension to this extensible.

public void AddExtension<T>(T extension) where T : Extension

Parameters

extension T

An instance of the extension to add. The extension will be disposed if the extension could not be added to this extensible.

Type Parameters

T

The 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

player IPlayer

The player to attach the text label to.

offset Vector3

The offset from the player's position.

AttachToVehicle(IVehicle, Vector3)

Attaches the text label to a vehicle.

public void AttachToVehicle(IVehicle vehicle, Vector3 offset)

Parameters

vehicle IVehicle

The vehicle to attach the text label to.

offset Vector3

The 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

position Vector3

The 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

position Vector3

The new position for the text label after detachment.

Equals(IPlayerTextLabel)

public bool Equals(IPlayerTextLabel other)

Parameters

other IPlayerTextLabel

Returns

bool

Equals(object?)

public override bool Equals(object? other)

Parameters

other object

Returns

bool

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

colour Colour

When 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

id UID

The 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

T

The type of the managed extension.

Exceptions

ArgumentException

Thrown if the extension could not be found.

GetHashCode()

public override int GetHashCode()

Returns

int

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

true if 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

T

The type of the unmanaged extension.

RemoveExtension(IExtension)

Removes the specified extension from this extensible.

public void RemoveExtension(IExtension extension)

Parameters

extension IExtension

The 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

id UID

The 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

extension T

The managed extension to remove.

Type Parameters

T

The 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

colour Colour

The 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

colour Colour

The colour to set.

text string

The text to set.

SetDrawDistance(float)

Sets the draw distance for the text label.

public void SetDrawDistance(float dist)

Parameters

dist float

The draw distance in units.

SetPosition(Vector3)

Sets the position of this entity.

public void SetPosition(Vector3 position)

Parameters

position Vector3

The position to set.

SetRotation(GTAQuat)

Sets the rotation of this entity.

public void SetRotation(GTAQuat rotation)

Parameters

rotation GTAQuat

The rotation to set.

SetTestLOS(bool)

Sets whether line-of-sight testing is enabled for the text label.

public void SetTestLOS(bool status)

Parameters

status bool

true to enable line-of-sight testing; false to disable it.

SetText(string)

Sets the text content of the text label.

public void SetText(string text)

Parameters

text string

The new text to display.

SetVirtualWorld(int)

Sets the virtual world of this entity.

public void SetVirtualWorld(int vw)

Parameters

vw int

The 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 T or null if no extension with the specified type could be found.

Type Parameters

T

The 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

extension T

The extension if found, otherwise null.

Returns

bool

true if the extension was found; false otherwise.

Type Parameters

T

The 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

lhs IPlayerTextLabel

The value on the left side of the operator.

rhs object

The value on the right side of the operator.

Returns

bool

true if the values are equal; otherwise, false.

explicit operator IPlayerTextLabel(IEntity)

Casts the IEntity to a IPlayerTextLabel.

public static explicit operator IPlayerTextLabel(IEntity value)

Parameters

value IEntity

The IEntity to cast.

Returns

IPlayerTextLabel

The converted IPlayerTextLabel.

explicit operator IPlayerTextLabel(IExtensible)

Casts the IExtensible to a IPlayerTextLabel.

public static explicit operator IPlayerTextLabel(IExtensible value)

Parameters

value IExtensible

The 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

value IIDProvider

The 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

value IPlayerTextLabel

The IPlayerTextLabel to cast.

Returns

IEntity

The converted IEntity.

explicit operator IExtensible(IPlayerTextLabel)

Casts the IPlayerTextLabel to a IExtensible.

public static explicit operator IExtensible(IPlayerTextLabel value)

Parameters

value IPlayerTextLabel

The 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

value IPlayerTextLabel

The IPlayerTextLabel to cast.

Returns

IIDProvider

The converted IIDProvider.

explicit operator ITextLabelBase(IPlayerTextLabel)

public static explicit operator ITextLabelBase(IPlayerTextLabel value)

Parameters

value IPlayerTextLabel

The IPlayerTextLabel to cast.

Returns

ITextLabelBase

The converted ITextLabelBase.

explicit operator IPlayerTextLabel(ITextLabelBase)

public static explicit operator IPlayerTextLabel(ITextLabelBase value)

Parameters

value ITextLabelBase

The 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

lhs IPlayerTextLabel

The value on the left side of the operator.

rhs object

The value on the right side of the operator.

Returns

bool

true if the values are not equal; otherwise, false.