Class: Renderer

me. Renderer

new Renderer(canvas, width, height, options)

a base renderer object
Parameters:
Name Type Argument Description
canvas Canvas The html canvas tag to draw to on screen.
width Number The width of the canvas without scaling
height Number The height of the canvas without scaling
options Object <optional>
The renderer parameters
Properties
Name Type Argument Default Description
doubleBuffering Boolean <optional>
false Whether to enable double buffering
antiAlias Boolean <optional>
false Whether to enable anti-aliasing
transparent Boolean <optional>
false Whether to enable transparency on the canvas (performance hit when enabled)
subPixel Boolean <optional>
false Whether to enable subpixel rendering (performance hit when enabled)
verbose Boolean <optional>
false Enable the verbose mode that provides additional details as to what the renderer is doing
zoomX Number <optional>
width The actual width of the canvas with scaling applied
zoomY Number <optional>
height The actual height of the canvas with scaling applied
Source:
renderer.js, line 28

Extends

Methods

<static> getCanvas() → {Canvas}

return a reference to the system canvas
Source:
renderer.js, line 133
Returns:
Type
Canvas

<static> getColor(current)

get the current fill & stroke style color.
Parameters:
Name Type Description
current me.Color global color
Source:
renderer.js, line 233

<static> getContext2d(canvas, opaque) → {Context2d}

Returns the 2D Context object of the given Canvas
Also configures anti-aliasing based on constructor options.
Parameters:
Name Type Argument Default Description
canvas Canvas
opaque Boolean <optional>
false True to disable transparency
Source:
renderer.js, line 167
Returns:
Type
Context2d

<static> getHeight() → {Number}

return the height of the system Canvas
Source:
renderer.js, line 222
Returns:
Type
Number

<static> getScreenCanvas() → {Canvas}

return a reference to the screen canvas
Source:
renderer.js, line 144
Returns:
Type
Canvas

<static> getScreenContext() → {Context2d}

return a reference to the screen canvas corresponding 2d Context
(will return buffered context if double buffering is enabled, or a reference to the Screen Context)
Source:
renderer.js, line 155
Returns:
Type
Context2d

<static> getWidth() → {Number}

return the width of the system Canvas
Source:
renderer.js, line 211
Returns:
Type
Number

<static> globalAlpha() → {Number}

return the current global alpha
Source:
renderer.js, line 244
Returns:
Type
Number

<static> resize(width, height)

resizes the system canvas
Parameters:
Name Type Description
width Number new width of the canvas
height Number new height of the canvas
Source:
renderer.js, line 255

<static> setAntiAlias(context, enable)

enable/disable image smoothing (scaling interpolation) for the specified 2d Context
(!) this might not be supported by all browsers
Parameters:
Name Type Argument Default Description
context Context2d
enable Boolean <optional>
false
Source:
renderer.js, line 268
Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:41+08:00 using the DocStrap template modified by codename-.