Table of Contents

Struct ITextDrawBase

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

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

[OpenMpApi(new Type[] { typeof(IExtensible), typeof(IIDProvider) })]
public readonly struct ITextDrawBase : IEquatable<ITextDrawBase>, ITextDrawBase.IManagedInterface, IExtensible.IManagedInterface, IIDProvider.IManagedInterface, IUnmanagedInterface
Implements
Inherited Members

Constructors

ITextDrawBase(nint)

Initializes a new instance of the ITextDrawBase struct.

public ITextDrawBase(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.

Equals(ITextDrawBase)

public bool Equals(ITextDrawBase other)

Parameters

other ITextDrawBase

Returns

bool

Equals(object?)

public override bool Equals(object? other)

Parameters

other object

Returns

bool

GetAlignment()

Gets the alignment of the textdraw's text.

public TextDrawAlignmentTypes GetAlignment()

Returns

TextDrawAlignmentTypes

The current text alignment.

GetBackgroundColour()

Gets the background colour of the textdraw.

public Colour GetBackgroundColour()

Returns

Colour

The background colour.

GetBoxColour()

Gets the colour of the textdraw's box.

public Colour GetBoxColour()

Returns

Colour

The colour of the textdraw's box.

GetBoxColour(out Colour)

Gets the colour of the textdraw's box.

public void GetBoxColour(out Colour colour)

Parameters

colour Colour

The box colour.

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.

GetLetterColour()

Gets the colour of the textdraw's letters.

public Colour GetLetterColour()

Returns

Colour

The colour of the textdraw's letters.

GetLetterSize()

Gets the size of the textdraw's letters.

public Vector2 GetLetterSize()

Returns

Vector2

The size of the textdraw's letters.

GetOutline()

Gets the outline thickness of the textdraw.

public int GetOutline()

Returns

int

The outline thickness.

GetPosition()

Gets the position of the textdraw.

public Vector2 GetPosition()

Returns

Vector2

The position of the textdraw.

GetPreviewModel()

Gets the preview model for the textdraw.

public int GetPreviewModel()

Returns

int

The model ID being previewed.

GetPreviewRotation()

Gets the preview rotation for the textdraw.

public Vector3 GetPreviewRotation()

Returns

Vector3

The rotation vector.

GetPreviewVehicleColour()

Gets the preview vehicle colours for the textdraw.

public (int, int) GetPreviewVehicleColour()

Returns

(int offset, int length)

A tuple containing the two vehicle colours.

GetPreviewZoom()

Gets the preview zoom factor for the textdraw.

public float GetPreviewZoom()

Returns

float

The preview zoom factor.

GetShadow()

Gets the shadow strength of the textdraw.

public int GetShadow()

Returns

int

The shadow strength.

GetStyle()

Gets the drawing style of the textdraw.

public TextDrawStyle GetStyle()

Returns

TextDrawStyle

The drawing style.

GetText()

Gets the text of the textdraw.

public string GetText()

Returns

string

The text currently displayed by the textdraw.

GetTextSize()

Gets the size of the textdraw area.

public Vector2 GetTextSize()

Returns

Vector2

The size of the textdraw area.

HasBox()

Gets whether the textdraw uses a box.

public bool HasBox()

Returns

bool

true if the textdraw uses a box; otherwise, false.

IsProportional()

Gets whether the textdraw is proportional.

public bool IsProportional()

Returns

bool

true if the textdraw is proportional; otherwise, false.

IsSelectable()

Gets whether the textdraw is selectable.

public bool IsSelectable()

Returns

bool

true if the textdraw is selectable; otherwise, false.

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.

Restream()

Re-streams the textdraw to all players to which it is currently streamed in.

public void Restream()

SetAlignment(TextDrawAlignmentTypes)

Sets the alignment of the textdraw's text.

public ref ITextDrawBase SetAlignment(TextDrawAlignmentTypes alignment)

Parameters

alignment TextDrawAlignmentTypes

The alignment to set.

Returns

ITextDrawBase

This instance for chaining.

SetBackgroundColour(Colour)

Sets the background colour of the textdraw.

public ref ITextDrawBase SetBackgroundColour(Colour colour)

Parameters

colour Colour

The new background colour.

Returns

ITextDrawBase

This instance for chaining.

SetBoxColour(Colour)

Sets the colour of the textdraw's box.

public ref ITextDrawBase SetBoxColour(Colour colour)

Parameters

colour Colour

The new box colour.

Returns

ITextDrawBase

This instance for chaining.

SetColour(Colour)

Sets the colour of the textdraw's letters.

public ref ITextDrawBase SetColour(Colour colour)

Parameters

colour Colour

The new letter colour.

Returns

ITextDrawBase

This instance for chaining.

SetLetterSize(Vector2)

Sets the size of the textdraw's letters.

public ref ITextDrawBase SetLetterSize(Vector2 size)

Parameters

size Vector2

The new letter size.

Returns

ITextDrawBase

This instance for chaining.

SetOutline(int)

Sets the outline of the textdraw.

public ref ITextDrawBase SetOutline(int outline)

Parameters

outline int

The outline thickness.

Returns

ITextDrawBase

This instance for chaining.

SetPosition(Vector2)

Sets the position of the textdraw.

public ref ITextDrawBase SetPosition(Vector2 position)

Parameters

position Vector2

The new position of the textdraw.

Returns

ITextDrawBase

This instance for chaining.

SetPreviewModel(int)

Sets the preview model for the textdraw.

public ref ITextDrawBase SetPreviewModel(int model)

Parameters

model int

The model ID to preview.

Returns

ITextDrawBase

This instance for chaining.

SetPreviewRotation(Vector3)

Sets the preview rotation for the textdraw.

public ref ITextDrawBase SetPreviewRotation(Vector3 rotation)

Parameters

rotation Vector3

The rotation vector.

Returns

ITextDrawBase

This instance for chaining.

SetPreviewVehicleColour(int, int)

Sets the preview vehicle colours for the textdraw.

public ref ITextDrawBase SetPreviewVehicleColour(int colour1, int colour2)

Parameters

colour1 int

The first vehicle colour.

colour2 int

The second vehicle colour.

Returns

ITextDrawBase

This instance for chaining.

SetPreviewZoom(float)

Sets the preview zoom factor for the textdraw.

public ref ITextDrawBase SetPreviewZoom(float zoom)

Parameters

zoom float

The zoom factor.

Returns

ITextDrawBase

This instance for chaining.

SetProportional(bool)

Sets whether the textdraw is proportional.

public ref ITextDrawBase SetProportional(bool proportional)

Parameters

proportional bool

Whether the textdraw is proportional. true for proportional, false otherwise.

Returns

ITextDrawBase

This instance for chaining.

SetSelectable(bool)

Sets whether the textdraw is selectable.

public ref ITextDrawBase SetSelectable(bool selectable)

Parameters

selectable bool

Whether the textdraw is selectable. true for selectable, false otherwise.

Returns

ITextDrawBase

This instance for chaining.

SetShadow(int)

Sets the shadow strength of the textdraw.

public ref ITextDrawBase SetShadow(int shadow)

Parameters

shadow int

The shadow strength.

Returns

ITextDrawBase

This instance for chaining.

SetStyle(TextDrawStyle)

Sets the drawing style of the textdraw.

public ref ITextDrawBase SetStyle(TextDrawStyle style)

Parameters

style TextDrawStyle

The drawing style.

Returns

ITextDrawBase

This instance for chaining.

SetText(string)

Sets the text of the textdraw.

public void SetText(string text)

Parameters

text string

The new text to display.

SetTextSize(Vector2)

Sets the size of the textdraw area.

public ref ITextDrawBase SetTextSize(Vector2 size)

Parameters

size Vector2

The new textdraw area size.

Returns

ITextDrawBase

This instance for chaining.

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.

UseBox(bool)

Sets whether the textdraw uses a box.

public ref ITextDrawBase UseBox(bool use)

Parameters

use bool

Whether to use a box. true to use a box, false otherwise.

Returns

ITextDrawBase

This instance for chaining.

Operators

operator ==(ITextDrawBase, object?)

Determines whether the specified values are equal.

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

Parameters

lhs ITextDrawBase

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 ITextDrawBase(IExtensible)

Casts the IExtensible to a ITextDrawBase.

public static explicit operator ITextDrawBase(IExtensible value)

Parameters

value IExtensible

The IExtensible to cast.

Returns

ITextDrawBase

The converted ITextDrawBase.

explicit operator ITextDrawBase(IIDProvider)

Casts the IIDProvider to a ITextDrawBase.

public static explicit operator ITextDrawBase(IIDProvider value)

Parameters

value IIDProvider

The IIDProvider to cast.

Returns

ITextDrawBase

The converted ITextDrawBase.

explicit operator IExtensible(ITextDrawBase)

Casts the ITextDrawBase to a IExtensible.

public static explicit operator IExtensible(ITextDrawBase value)

Parameters

value ITextDrawBase

The ITextDrawBase to cast.

Returns

IExtensible

The converted IExtensible.

explicit operator IIDProvider(ITextDrawBase)

Casts the ITextDrawBase to a IIDProvider.

public static explicit operator IIDProvider(ITextDrawBase value)

Parameters

value ITextDrawBase

The ITextDrawBase to cast.

Returns

IIDProvider

The converted IIDProvider.

operator !=(ITextDrawBase, object?)

Determines whether the specified values are not equal.

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

Parameters

lhs ITextDrawBase

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.