Table of Contents

Struct ITextLabelsComponent

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

This type represents a pointer to an unmanaged open.mp ITextLabelsComponent interface.

[OpenMpApi(new Type[] { typeof(IPoolComponent<ITextLabel>) })]
public readonly struct ITextLabelsComponent : IEquatable<ITextLabelsComponent>, ITextLabelsComponent.IManagedInterface, IPoolComponent<ITextLabel>.IManagedInterface, IComponent.IManagedInterface, IUnmanagedInterface
Implements
Inherited Members

Constructors

ITextLabelsComponent(nint)

Initializes a new instance of the ITextLabelsComponent struct.

public ITextLabelsComponent(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

AsPool()

Converts this component to a pool.

public IPool<ITextLabel> AsPool()

Returns

IPool<ITextLabel>

A pool.

ComponentName()

Gets the name of the component.

public string ComponentName()

Returns

string

The component name.

ComponentVersion()

Gets the version of the component.

public SemanticVersion ComponentVersion()

Returns

SemanticVersion

The component version.

Create(string, Colour, Vector3, float, int, bool)

Creates a new text label with the specified properties.

public ITextLabel Create(string text, Colour colour, Vector3 pos, float drawDist, int vw, bool los)

Parameters

text string

The text to display in the label.

colour Colour

The color of the text label.

pos Vector3

The position of the text label.

drawDist float

The draw distance for the text label.

vw int

The virtual world in which the text label is visible.

los bool

A value indicating whether the text label requires line of sight to be visible.

Returns

ITextLabel

The created text label.

Create(string, Colour, Vector3, float, int, bool, IPlayer)

Creates a new text label attached to a player with the specified properties.

[OpenMpApiOverload("_player")]
public ITextLabel Create(string text, Colour colour, Vector3 pos, float drawDist, int vw, bool los, IPlayer attach)

Parameters

text string

The text to display in the label.

colour Colour

The color of the text label.

pos Vector3

The position of the text label.

drawDist float

The draw distance for the text label.

vw int

The virtual world in which the text label is visible.

los bool

A value indicating whether the text label requires line of sight to be visible.

attach IPlayer

The player to which the text label is attached.

Returns

ITextLabel

The created text label.

Create(string, Colour, Vector3, float, int, bool, IVehicle)

Creates a new text label attached to a vehicle with the specified properties.

[OpenMpApiOverload("_vehicle")]
public ITextLabel Create(string text, Colour colour, Vector3 pos, float drawDist, int vw, bool los, IVehicle attach)

Parameters

text string

The text to display in the label.

colour Colour

The color of the text label.

pos Vector3

The position of the text label.

drawDist float

The draw distance for the text label.

vw int

The virtual world in which the text label is visible.

los bool

A value indicating whether the text label requires line of sight to be visible.

attach IVehicle

The vehicle to which the text label is attached.

Returns

ITextLabel

The created text label.

Equals(ITextLabelsComponent)

public bool Equals(ITextLabelsComponent other)

Parameters

other ITextLabelsComponent

Returns

bool

Equals(object?)

public override bool Equals(object? other)

Parameters

other object

Returns

bool

GetComponentType()

Gets the type of the component.

public ComponentType GetComponentType()

Returns

ComponentType

The component type.

GetHashCode()

public override int GetHashCode()

Returns

int

SupportedVersion()

Gets the supported version of the component.

public int SupportedVersion()

Returns

int

The supported version of the component.

Remarks

The idea is for the SDK to be totally forward compatible, so code built at any time will always work, thanks to ABI compatibility. This method is an emergency trap door, just in case that's ever not the problem. Check which major version this component was built for, if it isn't the current major version, fail to load it. Always just returns a constant, recompiling will often be enough to upgrade. virtual and final to be the vtable, but it can't be overridden because it is a constant.

Operators

operator ==(ITextLabelsComponent, object?)

Determines whether the specified values are equal.

public static bool operator ==(ITextLabelsComponent lhs, object? rhs)

Parameters

lhs ITextLabelsComponent

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 ITextLabelsComponent(IComponent)

public static explicit operator ITextLabelsComponent(IComponent value)

Parameters

value IComponent

The IComponent to cast.

Returns

ITextLabelsComponent

The converted ITextLabelsComponent.

explicit operator ITextLabelsComponent(IPoolComponent<ITextLabel>)

public static explicit operator ITextLabelsComponent(IPoolComponent<ITextLabel> value)

Parameters

value IPoolComponent<ITextLabel>

The IPoolComponent<T> to cast.

Returns

ITextLabelsComponent

The converted ITextLabelsComponent.

explicit operator IComponent(ITextLabelsComponent)

public static explicit operator IComponent(ITextLabelsComponent value)

Parameters

value ITextLabelsComponent

The ITextLabelsComponent to cast.

Returns

IComponent

The converted IComponent.

explicit operator IPoolComponent<ITextLabel>(ITextLabelsComponent)

public static explicit operator IPoolComponent<ITextLabel>(ITextLabelsComponent value)

Parameters

value ITextLabelsComponent

The ITextLabelsComponent to cast.

Returns

IPoolComponent<ITextLabel>

The converted IPoolComponent<T>.

operator !=(ITextLabelsComponent, object?)

Determines whether the specified values are not equal.

public static bool operator !=(ITextLabelsComponent lhs, object? rhs)

Parameters

lhs ITextLabelsComponent

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.

Explicit Interface Implementations

ComponentId

Gets the identifier of the component type.

static UID ComponentId { get; }

Returns

UID

FromComponentHandle(nint)

Casts a handle from a IComponent handle to a handle of this type.

static nint FromComponentHandle(nint handle)

Parameters

handle nint

The IComponent handle.

Returns

nint

The handle of this type.