class Draw (client-side)
Available since version: 0.3.0
Constructor
Draw.new()
Parameters:
No parameters.
Constructor
Draw.new(int x, int y, string text)
Parameters:
intx: Initial X position (virtual units).inty: Initial Y position (virtual units).stringtext: Initial text content.
Properties
{x, y} position
Gets or sets the draw position in virtual screen units.
{x, y} positionPx
Gets or sets the draw position in pixel coordinates.
string text
Gets or sets the displayed text.
string font
Gets or sets the font identifier used for rendering.
{r, g, b} color (read-only)
Returns the current text color.
int alpha
Gets or sets the alpha (opacity).
bool visible
Gets or sets whether the Draw object is rendered.
Methods
setPosition
Sets the draw position in virtual screen units.
void setPosition(int x, int y)
Parameters:
intx: X position (virtual units).inty: Y position (virtual units).
getPosition
Returns the draw position in virtual screen units.
{x, y} getPosition()
Returns {x, y}:
Table containing x and y (virtual units).
setPositionPx
Sets the draw position in pixel coordinates.
void setPositionPx(int x, int y)
Parameters:
intx: X position in pixels.inty: Y position in pixels.
getPositionPx
Returns the draw position in pixel coordinates.
{x, y} getPositionPx()
Returns {x, y}:
Table containing x and y in pixels.
setText
Sets the text to render.
void setText(string text)
Parameters:
stringtext: Text to display.
getText
Returns the current text.
string getText()
Returns string:
Current text.
setFont
Sets the font used for rendering.
void setFont(string font)
Parameters:
stringfont: Font file name.
getFont
Returns the current font file name.
string getFont()
Returns string:
Font file name.
setColor
Sets the text color.
void setColor(int r, int g, int b)
Parameters:
intr: Red component (0-255).intg: Green component (0-255).intb: Blue component (0-255).
getColor
Returns the current text color.
{r, g, b} getColor()
Returns {r, g, b}:
Table containing r,g,b (0-255).
setAlpha
Sets text alpha (opacity).
void setAlpha(int alpha)
Parameters:
intalpha: Opacity value (0-255).
getAlpha
Returns the current alpha (opacity).
int getAlpha()
Returns int:
Opacity value (0-255).
setVisible
Sets whether the Draw object should render.
void setVisible(bool visible)
Parameters:
boolvisible: True to render, false to hide.
getVisible
Returns whether this Draw object is visible.
bool getVisible()
Returns bool:
True if visible.
Callbacks
No callbacks.