Engine.Draw

The Draw library provides functions to draw shapes, text, and sprites on a scene.

Table of contents

Engine.Draw.Line(x1, y1, x2, y2, options)
Engine.Draw.Rectangle(x1, y1, x2, y2, options)
Draws a rectangle.
x1
The X coordinate of the top left corner.
y1
The Y coordinate of the top left corner.
x2
The X coordinate of the right bottom corner.
y2
The Y coordinate of the right bottom corner.
options
Optional. Options for drawing the rectangle.
width
Width of the outline in pixels.
linecolor
The color of the outline.
cap
The type line cap for the outline.
rx
The horizontal radius of the corners of the rectangle.
ry
The vertical radius of the corners of the rectangle.
radius
A short-hand option that sets both rx and ry.
color
The fill color of the rectangle.
alpha
The alpha value of the rectangle.
Example: Draw a blue rectangle with a yellow outline, rounded borders and at 70% opacity
Code:
Engine.Draw.Rectangle(20, 30, 150, 180, {
	linecolor: "yellow",
	color: "blue",
	radius: 8,
	alpha: 0.7
});