Adds the given canvas element to the DOM.
Adds the given canvas element to the DOM. The canvas will be added as a child of the given parent. If no parent is given it will be added as a child of the document.body.
The canvas to be added to the DOM.
The DOM element to add the canvas to.
If set to true it will add the overflow='hidden' style to the parent DOM element.
Returns the source canvas.
Creates a canvas
DOM element.
Creates a canvas
DOM element. The element is not automatically added to the document.
The object that will own the canvas that is created.
The width of the canvas element.
The height of the canvas element.
If specified, and not the empty string, this will be set as the ID of the canvas element. Otherwise no ID will be set.
If true
the canvas will not be placed in the CanvasPool global.
The newly created canvas element.
Returns true
if the given context has image smoothing enabled, otherwise returns false
.
Returns true
if the given context has image smoothing enabled, otherwise returns false
.
The context to check for smoothing on.
True if the given context has image smoothing enabled, otherwise false.¬
Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set.
Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set.
The context to enable or disable the image smoothing on.
Returns the smoothingEnabled vendor prefix, or null if not set on the context.
Removes the given canvas element from the DOM.
Removes the given canvas element from the DOM.
The canvas to be removed from the DOM.
Sets the background color behind the canvas.
Sets the background color behind the canvas. This changes the canvas style property.
The canvas to set the background color on.
The color to set. Can be in the format 'rgb(r,g,b)', or '#RRGGBB' or any valid CSS color.
the source canvas.
Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto').
Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto'). Note that if this doesn't given the desired result then see the CanvasUtils.setSmoothingEnabled method.
The canvas to set image-rendering bicubic on.
the source canvas.
Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast' on webkit).
Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast' on webkit). Note that if this doesn't given the desired result then see the setSmoothingEnabled.
The canvas to set image-rendering crisp on.
the source canvas.
Sets the Image Smoothing property on the given context.
Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. By default browsers have image smoothing enabled, which isn't always what you visually want, especially when using pixel art in a game. Note that this sets the property on the context itself, so that any image drawn to the context will be affected. This sets the property across all current browsers but support is patchy on earlier browsers, especially on mobile.
The context to enable or disable the image smoothing on.
If set to true it will enable image smoothing, false will disable it.
the source context.
Sets the touch-action property on the canvas style.
Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions.
The canvas to set the touch action on.
The touch action to set. Defaults to 'none'.
The source canvas.
Sets the transform of the given canvas to the matrix values provided.
Sets the transform of the given canvas to the matrix values provided.
The context to set the transform on.
The value to translate horizontally by.
The value to translate vertically by.
The value to scale horizontally by.
The value to scale vertically by.
The value to skew horizontally by.
The value to skew vertically by.
the source context.
Sets the user-select property on the canvas style.
Sets the user-select property on the canvas style. Can be used to disable default browser selection actions.
The canvas to set the touch action on.
The touch action to set. Defaults to 'none'.
The source canvas.
Canvas Singleton