Properties:
Name | Type | Description |
---|---|---|
height |
number |
Height of the canvas. |
parentNode |
ICanvasParentNode | null |
Parent node of the canvas. |
style |
ICanvasStyle |
Style of the canvas. |
width |
number |
Width of the canvas. |
Extends
- PixiMixins.ICanvas
- Partial.<EventTarget>
Members
Height of the canvas.
Parent node of the canvas.
Style of the canvas.
Width of the canvas.
Methods
Adds the listener for the specified event.
Name | Type | Description |
---|---|---|
type |
string |
The type of event to listen for. |
listener |
EventListenerOrEventListenerObject |
The callback to invoke when the event is fired. |
options |
boolean | AddEventListenerOptions |
The options for adding event listener. |
Get the content of the canvas as Blob.
Name | Type | Attributes | Description |
---|---|---|---|
options |
object |
<optional> |
The options for creating Blob. |
options.type |
string |
<optional> |
A string indicating the image format. The default type is |
options.quality |
string |
<optional> |
A number between 0 and 1 indicating the image quality to be used when
creating images using file formats that support lossy compression (such as |
Returns:
Type | Description |
---|---|
Promise<Blob> | A Promise returning a Blob object representing the image contained in the canvas. |
Dispatches a event.
Name | Type | Description |
---|---|---|
event |
Event |
The Event object to dispatch. Its Event.target property will be set to the current EventTarget. |
Returns:
Type | Description |
---|---|
boolean | Returns false if event is cancelable, and at least one of the event handlers which received event called Event.preventDefault(). Otherwise true. |
Get the position and the size of the canvas.
Returns:
Type | Description |
---|---|
ICanvasRect | The smallest rectangle which contains the entire canvas. |
Get rendering context of the canvas.
Name | Type | Attributes | Description |
---|---|---|---|
contextId |
ContextIds |
The identifier of the type of context to create. |
|
options |
ContextSettings |
<optional> |
The options for creating context. |
Returns:
Type | Description |
---|---|
RenderingContext | unknown | The created context, or null if contextId is not supported. |
Removes the listener for the specified event.
Name | Type | Description |
---|---|---|
type |
string |
The type of event to listen for. |
listener |
EventListenerOrEventListenerObject |
The callback to invoke when the event is fired. |
options |
boolean | EventListenerOptions |
The options for removing event listener. |
Creates a Blob from the content of the canvas.
Name | Type | Attributes | Description |
---|---|---|---|
callback |
unknown |
A callback function with the resulting |
|
type |
string |
<optional> |
A string indicating the image format. The default type is |
quality |
string |
<optional> |
A number between 0 and 1 indicating the image quality to be used when
creating images using file formats that support lossy compression (such as |
Get the content of the canvas as data URL.
Name | Type | Attributes | Description |
---|---|---|---|
type |
string |
<optional> |
A string indicating the image format. The default type is |
quality |
string |
<optional> |
A number between 0 and 1 indicating the image quality to be used when
creating images using file formats that support lossy compression (such as |
Returns:
Type | Description |
---|---|
string | A string containing the requested data URL. |