The decimal midpoint of parent element size.
How many pixels have one grid unit.
Private
Readonly
handlerRenderer owner.
Gets canvas height in pixels.
Sets canvas height in pixels.
The new height
Gets canvas width in pixels.
Sets canvas width in pixels.
The new width
Gets the CanvasRenderingContext2D.
Private
combineCombines given draw settings with default draw settings.
The combined draw settings
const drawSettings = renderer.combineDrawSettings({ color: 'red' });
The given draw settings
Draws arrow from position to another position.
renderer.drawArrow(2, 3, 3, 4);
From X-coordinate
From Y-coordinate
To X-coordinate
To Y-coordinate
Optional
drawSettings: DrawSettingsThe draw settings
Draws a circle.
renderer.drawCircle(0, 0, 1, { color: 'yellow' });
The X-coordinate
The Y-coordinate
The diameter
Optional
drawSettings: DrawSettingsThe draw settings
Draws hitbox with direction arrow.
const exampleClickableObject = ...;
renderer.drawHitbox(exampleClickableObject);
The clickable game object
Draws image.
renderer.drawImage(game.GetImage('player'), 0, 0, 1, 1, { angle: 45 });
The image
The X-coordinate
The Y-coordinate
The width
The height
Optional
drawSettings: DrawSettingsThe draw settings
Draws line from position to another position.
renderer.drawLine(2, 3, 3, 4);
From X-coordinate
From Y-coordinate
To X-coordinate
To Y-coordinate
Optional
drawSettings: DrawSettingsThe draw settings
Draws a rect.
renderer.drawRectangle(5, 2, 1, 1, { color: 'green', border: true });
The X-coordinate
The Y-coordinate
The width
The height
Optional
drawSettings: DrawSettingsThe draw settings
Fills canvas with content.
renderer.fill('white');
renderer.fill({ color: 'white' })
renderer.fill(game.GetImage('background'));
The color, image or DrawSettings
Fills the canvas with color property from settings.
The settings
Private
setSets canvas context properties to given settings.
The draw settings
Class represents Game Renderer.