Table of Contents

Class TextDraw

Namespace
SampSharp.Entities.SAMP
Assembly
SampSharp.OpenMp.Entities.dll

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

textDraws ITextDrawsComponent
textDraw ITextDraw

Properties

Alignment

Gets or sets the alignment of this text draw.

public virtual TextDrawAlignment Alignment { get; set; }

Property Value

TextDrawAlignment

BackColor

Gets or sets the background Color of this text draw.

public virtual Color BackColor { get; set; }

Property Value

Color

BoxColor

Gets or sets the Color of the box in this text draw.

public virtual Color BoxColor { get; set; }

Property Value

Color

Font

Gets or sets the font of this text draw.

public virtual TextDrawFont Font { get; set; }

Property Value

TextDrawFont

ForeColor

Gets or sets the foreground Color of this text draw.

public virtual Color ForeColor { get; set; }

Property Value

Color

IsOmpEntityDestroyed

Gets a value indicating whether the open.mp entity counterpart has been destroyed.

protected bool IsOmpEntityDestroyed { get; }

Property Value

bool

LetterSize

Gets or sets the size of the letters in this text draw.

public virtual Vector2 LetterSize { get; set; }

Property Value

Vector2

Outline

Gets or sets the outline size of this text draw.

public virtual int Outline { get; set; }

Property Value

int

Position

Gets or sets the position of this text draw.

public virtual Vector2 Position { get; set; }

Property Value

Vector2

PreviewModel

Gets or sets the preview model ID displayed in this text draw.

public virtual int PreviewModel { get; set; }

Property Value

int

PreviewRotation

Gets or sets the preview model rotation of this text draw.

public virtual Vector3 PreviewRotation { get; set; }

Property Value

Vector3

PreviewZoom

Gets the preview model zoom of this text draw.

public virtual float PreviewZoom { get; }

Property Value

float

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

bool

Selectable

Gets or sets a value indicating whether this text draw is selectable by players.

public virtual bool Selectable { get; set; }

Property Value

bool

Shadow

Gets or sets the shadow size of this text draw.

public virtual int Shadow { get; set; }

Property Value

int

Text

Gets or sets the text displayed in this text draw.

public virtual string Text { get; set; }

Property Value

string

TextSize

Gets or sets the size of this text draw box and clickable area.

public virtual Vector2 TextSize { get; set; }

Property Value

Vector2

UseBox

Gets or sets a value indicating whether a box is displayed for this text draw.

public virtual bool UseBox { get; set; }

Property Value

bool

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

player Player

The 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

rotation Vector3

The rotation of the preview model as a Vector3.

zoom float

The 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

color1 int

The primary color of the preview vehicle.

color2 int

The 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

player Player

The player.

text string

The new text.

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

player Player

The Player to show this text draw to.

ToString()

public override string ToString()

Returns

string

Operators

implicit operator ITextDraw(TextDraw?)

Performs an implicit conversion from TextDraw to ITextDraw.

public static implicit operator ITextDraw(TextDraw? textDraw)

Parameters

textDraw TextDraw

Returns

ITextDraw