Struct ITextDrawsComponent
This type represents a pointer to an unmanaged open.mp ITextDrawsComponent interface.
[OpenMpApi(new Type[] { typeof(IPoolComponent<ITextDraw>) })]
public readonly struct ITextDrawsComponent : IEquatable<ITextDrawsComponent>, ITextDrawsComponent.IManagedInterface, IPoolComponent<ITextDraw>.IManagedInterface, IComponent.IManagedInterface, IUnmanagedInterface
- Implements
- Inherited Members
Constructors
ITextDrawsComponent(nint)
Initializes a new instance of the ITextDrawsComponent struct.
public ITextDrawsComponent(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()
Converts this component to a pool.
public IPool<ITextDraw> AsPool()
Returns
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(Vector2, int)
Creates a new text draw with the specified position and preview model.
[OpenMpApiOverload("_model")]
public ITextDraw Create(Vector2 position, int model)
Parameters
Returns
- ITextDraw
The created text draw.
Create(Vector2, string)
Creates a new text draw with the specified position and text.
public ITextDraw Create(Vector2 position, string text)
Parameters
Returns
- ITextDraw
The created text draw.
Equals(ITextDrawsComponent)
public bool Equals(ITextDrawsComponent other)
Parameters
otherITextDrawsComponent
Returns
Equals(object?)
public override bool Equals(object? other)
Parameters
otherobject
Returns
GetComponentType()
Gets the type of the component.
public ComponentType GetComponentType()
Returns
- ComponentType
The component type.
GetEventDispatcher()
Retrieves the event dispatcher for text draw events.
public IEventDispatcher<ITextDrawEventHandler> GetEventDispatcher()
Returns
GetHashCode()
public override int GetHashCode()
Returns
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 ==(ITextDrawsComponent, object?)
Determines whether the specified values are equal.
public static bool operator ==(ITextDrawsComponent lhs, object? rhs)
Parameters
lhsITextDrawsComponentThe 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 ITextDrawsComponent(IComponent)
Casts the IComponent to a ITextDrawsComponent.
public static explicit operator ITextDrawsComponent(IComponent value)
Parameters
valueIComponentThe IComponent to cast.
Returns
- ITextDrawsComponent
The converted ITextDrawsComponent.
explicit operator ITextDrawsComponent(IPoolComponent<ITextDraw>)
Casts the IPoolComponent<T> to a ITextDrawsComponent.
public static explicit operator ITextDrawsComponent(IPoolComponent<ITextDraw> value)
Parameters
valueIPoolComponent<ITextDraw>The IPoolComponent<T> to cast.
Returns
- ITextDrawsComponent
The converted ITextDrawsComponent.
explicit operator IComponent(ITextDrawsComponent)
Casts the ITextDrawsComponent to a IComponent.
public static explicit operator IComponent(ITextDrawsComponent value)
Parameters
valueITextDrawsComponentThe ITextDrawsComponent to cast.
Returns
- IComponent
The converted IComponent.
explicit operator IPoolComponent<ITextDraw>(ITextDrawsComponent)
Casts the ITextDrawsComponent to a IPoolComponent<T>.
public static explicit operator IPoolComponent<ITextDraw>(ITextDrawsComponent value)
Parameters
valueITextDrawsComponentThe ITextDrawsComponent to cast.
Returns
- IPoolComponent<ITextDraw>
The converted IPoolComponent<T>.
operator !=(ITextDrawsComponent, object?)
Determines whether the specified values are not equal.
public static bool operator !=(ITextDrawsComponent lhs, object? rhs)
Parameters
lhsITextDrawsComponentThe 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
ComponentId
Gets the identifier of the component type.
static UID ComponentId { get; }
Returns
FromComponentHandle(nint)
Casts a handle from a IComponent handle to a handle of this type.
static nint FromComponentHandle(nint handle)
Parameters
handlenintThe IComponent handle.
Returns
- nint
The handle of this type.