Class TextDraw
Represents a component which provides the data and functionality of a text draw.
public class TextDraw : IdProvider
- Inheritance
-
TextDraw
- Inherited Members
Constructors
TextDraw(ITextDrawsComponent, ITextDraw)
Initializes a new instance of the TextDraw class.
protected TextDraw(ITextDrawsComponent textDraws, ITextDraw textDraw)
Parameters
textDrawsITextDrawsComponenttextDrawITextDraw
Properties
Alignment
Gets or sets the alignment of this text draw.
public virtual TextDrawAlignment Alignment { get; set; }
Property Value
BackColor
Gets or sets the background Color of this text draw.
public virtual Color BackColor { get; set; }
Property Value
BoxColor
Gets or sets the Color of the box in this text draw.
public virtual Color BoxColor { get; set; }
Property Value
Font
Gets or sets the font of this text draw.
public virtual TextDrawFont Font { get; set; }
Property Value
ForeColor
Gets or sets the foreground Color of this text draw.
public virtual Color ForeColor { get; set; }
Property Value
IsOmpEntityDestroyed
Gets a value indicating whether the open.mp entity counterpart has been destroyed.
protected bool IsOmpEntityDestroyed { get; }
Property Value
LetterSize
Gets or sets the size of the letters in this text draw.
public virtual Vector2 LetterSize { get; set; }
Property Value
Outline
Gets or sets the outline size of this text draw.
public virtual int Outline { get; set; }
Property Value
Position
Gets or sets the position of this text draw.
public virtual Vector2 Position { get; set; }
Property Value
PreviewModel
Gets or sets the preview model ID displayed in this text draw.
public virtual int PreviewModel { get; set; }
Property Value
PreviewRotation
Gets or sets the preview model rotation of this text draw.
public virtual Vector3 PreviewRotation { get; set; }
Property Value
PreviewZoom
Gets the preview model zoom of this text draw.
public virtual float PreviewZoom { get; }
Property Value
Proportional
Gets or sets a value indicating whether the text of this text draw uses proportional spacing.
public virtual bool Proportional { get; set; }
Property Value
Selectable
Gets or sets a value indicating whether this text draw is selectable by players.
public virtual bool Selectable { get; set; }
Property Value
Shadow
Gets or sets the shadow size of this text draw.
public virtual int Shadow { get; set; }
Property Value
Text
Gets or sets the text displayed in this text draw.
public virtual string Text { get; set; }
Property Value
TextSize
Gets or sets the size of this text draw box and clickable area.
public virtual Vector2 TextSize { get; set; }
Property Value
UseBox
Gets or sets a value indicating whether a box is displayed for this text draw.
public virtual bool UseBox { get; set; }
Property Value
Methods
Hide()
Hides this text draw for all players.
public virtual void Hide()
Hide(Player)
Hides this text draw for the specified player.
public virtual void Hide(Player player)
Parameters
playerPlayerThe player to hide this text draw from.
OnDestroyComponent()
This method is invoked before this component is destroyed and removed from its entity.
protected override void OnDestroyComponent()
Restream()
Forces this text draw to be re-sent to all players who currently have it visible.
public virtual void Restream()
SetPreviewRotation(Vector3, float)
Sets the preview model rotation and zoom of this text draw.
public virtual void SetPreviewRotation(Vector3 rotation, float zoom = 1)
Parameters
rotationVector3The rotation of the preview model as a Vector3.
zoomfloatThe zoom level of the preview model.
SetPreviewVehicleColor(int, int)
Sets the preview vehicle colors of this text draw.
public virtual void SetPreviewVehicleColor(int color1, int color2)
Parameters
color1intThe primary color of the preview vehicle.
color2intThe secondary color of the preview vehicle.
SetTextForPlayer(Player, string)
Updates the displayed text of this text draw for a single player without hiding/showing it.
public virtual void SetTextForPlayer(Player player, string text)
Parameters
Show()
Shows this text draw to all players.
public virtual void Show()
Show(Player)
Shows this text draw to the specified player.
public virtual void Show(Player player)
Parameters
ToString()
public override string ToString()
Returns
Operators
implicit operator ITextDraw(TextDraw?)
public static implicit operator ITextDraw(TextDraw? textDraw)
Parameters
textDrawTextDraw