draw
This module lets you draw things on screen: images, shapes, text, and more.
Use it to show characters, backgrounds, decorations, and visual effects.
api
• draw.newImage••••••••••Loads an image from a file.
Use it in load
to prepare graphics before displaying them.
• draw.image•••••••••••••Draws an image on screen at a specific position and size.
• draw.sprite••••••••••••Draws a sprite from an image divided into frames.
• draw.rectangle•••••••••Draws a rectangle.
• draw.lines•••••••••••••Draws lines connecting multiple points.
• draw.polygon•••••••••••Draws a polygon using the given vertices.
• draw.circle••••••••••••Draws a circle.
• draw.arc•••••••••••••••Draws a circular arc from angle ang1 to ang2.
• draw.text••••••••••••••Displays text on screen.
• draw.setFont•••••••••••Changes the text's font size and type.
• draw.setColor••••••••••Sets the color for the next drawing (lines, text, etc).
• draw.setFillColor••••••Sets the fill color for solid shapes.
• draw.setLineColor••••••Changes the border color of shapes.
• draw.setLineSize•••••••Changes the line thickness.
• draw.setLineCap••••••••Sets the style of line ends.
• draw.setLineJoin•••••••Sets the style of line joins.
• draw.setAlpha••••••••••Changes the transparency of drawings.
• draw.setMaskMode•••••••Defines the drawing mask.
• draw.setBlendingMode•••Changes how colors blend with what’s already on screen.
• draw.setFilter•••••••••Applies a visual filter to the drawing (like smoothing or pixelation).