Struct IPlayerTextDraw
This type represents a pointer to an unmanaged open.mp IPlayerTextDraw interface.
[OpenMpApi(new Type[] { typeof(ITextDrawBase) })]
public readonly struct IPlayerTextDraw : IEquatable<IPlayerTextDraw>, IPlayerTextDraw.IManagedInterface, ITextDrawBase.IManagedInterface, IExtensible.IManagedInterface, IIDProvider.IManagedInterface, IUnmanagedInterface
- Implements
- Inherited Members
Constructors
IPlayerTextDraw(nint)
Initializes a new instance of the IPlayerTextDraw struct.
public IPlayerTextDraw(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.
Equals(IPlayerTextDraw)
public bool Equals(IPlayerTextDraw other)
Parameters
otherIPlayerTextDraw
Returns
Equals(object?)
public override bool Equals(object? other)
Parameters
otherobject
Returns
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
colourColourThe box colour.
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.
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
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
Hide()
Hides the player-specific text draw.
public void Hide()
IsProportional()
Gets whether the textdraw is proportional.
public bool IsProportional()
Returns
IsSelectable()
Gets whether the textdraw is selectable.
public bool IsSelectable()
Returns
IsShown()
Determines whether the player-specific text draw is currently shown.
public bool IsShown()
Returns
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.
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
alignmentTextDrawAlignmentTypesThe 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
colourColourThe 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
colourColourThe 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
colourColourThe 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
sizeVector2The new letter size.
Returns
- ITextDrawBase
This instance for chaining.
SetOutline(int)
Sets the outline of the textdraw.
public ref ITextDrawBase SetOutline(int outline)
Parameters
outlineintThe outline thickness.
Returns
- ITextDrawBase
This instance for chaining.
SetPosition(Vector2)
Sets the position of the textdraw.
public ref ITextDrawBase SetPosition(Vector2 position)
Parameters
positionVector2The 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
modelintThe 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
rotationVector3The 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
Returns
- ITextDrawBase
This instance for chaining.
SetPreviewZoom(float)
Sets the preview zoom factor for the textdraw.
public ref ITextDrawBase SetPreviewZoom(float zoom)
Parameters
zoomfloatThe zoom factor.
Returns
- ITextDrawBase
This instance for chaining.
SetProportional(bool)
Sets whether the textdraw is proportional.
public ref ITextDrawBase SetProportional(bool proportional)
Parameters
Returns
- ITextDrawBase
This instance for chaining.
SetSelectable(bool)
Sets whether the textdraw is selectable.
public ref ITextDrawBase SetSelectable(bool selectable)
Parameters
Returns
- ITextDrawBase
This instance for chaining.
SetShadow(int)
Sets the shadow strength of the textdraw.
public ref ITextDrawBase SetShadow(int shadow)
Parameters
shadowintThe shadow strength.
Returns
- ITextDrawBase
This instance for chaining.
SetStyle(TextDrawStyle)
Sets the drawing style of the textdraw.
public ref ITextDrawBase SetStyle(TextDrawStyle style)
Parameters
styleTextDrawStyleThe drawing style.
Returns
- ITextDrawBase
This instance for chaining.
SetText(string)
Sets the text of the textdraw.
public void SetText(string text)
Parameters
textstringThe new text to display.
SetTextSize(Vector2)
Sets the size of the textdraw area.
public ref ITextDrawBase SetTextSize(Vector2 size)
Parameters
sizeVector2The new textdraw area size.
Returns
- ITextDrawBase
This instance for chaining.
Show()
Shows the player-specific text draw.
public void Show()
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.
UseBox(bool)
Sets whether the textdraw uses a box.
public ref ITextDrawBase UseBox(bool use)
Parameters
Returns
- ITextDrawBase
This instance for chaining.
Operators
operator ==(IPlayerTextDraw, object?)
Determines whether the specified values are equal.
public static bool operator ==(IPlayerTextDraw lhs, object? rhs)
Parameters
lhsIPlayerTextDrawThe 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 IPlayerTextDraw(IExtensible)
Casts the IExtensible to a IPlayerTextDraw.
public static explicit operator IPlayerTextDraw(IExtensible value)
Parameters
valueIExtensibleThe IExtensible to cast.
Returns
- IPlayerTextDraw
The converted IPlayerTextDraw.
explicit operator IPlayerTextDraw(IIDProvider)
Casts the IIDProvider to a IPlayerTextDraw.
public static explicit operator IPlayerTextDraw(IIDProvider value)
Parameters
valueIIDProviderThe IIDProvider to cast.
Returns
- IPlayerTextDraw
The converted IPlayerTextDraw.
explicit operator IExtensible(IPlayerTextDraw)
Casts the IPlayerTextDraw to a IExtensible.
public static explicit operator IExtensible(IPlayerTextDraw value)
Parameters
valueIPlayerTextDrawThe IPlayerTextDraw to cast.
Returns
- IExtensible
The converted IExtensible.
explicit operator IIDProvider(IPlayerTextDraw)
Casts the IPlayerTextDraw to a IIDProvider.
public static explicit operator IIDProvider(IPlayerTextDraw value)
Parameters
valueIPlayerTextDrawThe IPlayerTextDraw to cast.
Returns
- IIDProvider
The converted IIDProvider.
explicit operator ITextDrawBase(IPlayerTextDraw)
Casts the IPlayerTextDraw to a ITextDrawBase.
public static explicit operator ITextDrawBase(IPlayerTextDraw value)
Parameters
valueIPlayerTextDrawThe IPlayerTextDraw to cast.
Returns
- ITextDrawBase
The converted ITextDrawBase.
explicit operator IPlayerTextDraw(ITextDrawBase)
Casts the ITextDrawBase to a IPlayerTextDraw.
public static explicit operator IPlayerTextDraw(ITextDrawBase value)
Parameters
valueITextDrawBaseThe ITextDrawBase to cast.
Returns
- IPlayerTextDraw
The converted IPlayerTextDraw.
operator !=(IPlayerTextDraw, object?)
Determines whether the specified values are not equal.
public static bool operator !=(IPlayerTextDraw lhs, object? rhs)
Parameters
lhsIPlayerTextDrawThe 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.