The game instance.
Creates a pixel font renderer function.
Optionalimage: HTMLImageElementThe image containing the pixel font.
OptionalfontSize: numberThe size of each character in the pixel font.
Optionalcolor: string = 'white'The color to apply to the pixel font.
The pixel font renderer function.
Draws a 2D image on the canvas.
The HTMLImageElement representing the image to be drawn.
The bounding box of the image.
The scale factor to apply to the image (default: 1).
The rotation angle of the image in radians (default: 0).
Whether to flip the image horizontally (default: false).
Whether to flip the image vertically (default: false).
Optionalclip: VectorThe clipping region of the image (optional).
Optionalcontext: CanvasRenderingContext2DThe CanvasRenderingContext2D to use for drawing (optional).
Draws a stroke using the provided points.
The x-coordinate of the starting point.
The y-coordinate of the starting point.
An array of Vector objects representing the points to be connected.
The width of the stroke line (default: 1).
Renders text on the canvas.
The text to render.
The position to render the text.
Optionalcolor: ColorThe color of the text. Defaults to white.
The font size of the text. Defaults to '1em'.
The horizontal alignment of the text. Defaults to 'left'.
The vertical alignment of the text. Defaults to 'top'.
Whether to stroke the text. Defaults to false.
The
Drawclass provides methods for drawing shapes, text, and images on a canvas.