(private) new xrx.canvas.Canvas(element)
Canvas rendering class representing a canvas.
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLCanvasElement | The HTML canvas element. |
Members
-
xrx.canvas.Canvas#element_ :HTMLCanvasElement
-
The HTML canvas element.
Type:
- HTMLCanvasElement
-
xrx.canvas.Canvas#height_ :number
-
The canvas height.
Type:
- number
-
xrx.canvas.Canvas#width_ :number
-
The canvas width.
Type:
- number
Methods
-
(static) xrx.canvas.Canvas.create(parent)
-
Creates a new canvas.
Parameters:
Name Type Description parent
Element The parent HTML element to which the canvas shall be appended. -
xrx.canvas.Canvas#finishDrawing()
-
Finishes drawing this canvas.
-
xrx.canvas.Canvas#getElement() → {HTMLCanvasElement}
-
Returns the HTML canvas element.
Returns:
The HTML canvas element.- Type
- HTMLCanvasElement
-
xrx.canvas.Canvas#getEventTarget() → {HTMLCanvasElement}
-
Returns the root element of this canvas to be used as the event target.
Returns:
The event target element.- Type
- HTMLCanvasElement
-
xrx.canvas.Canvas#getHeight() → {number}
-
Returns the height of the canvas.
Returns:
The height.- Type
- number
-
xrx.canvas.Canvas#getWidth() → {number}
-
Returns the width of the canvas.
Returns:
The width.- Type
- number
-
xrx.canvas.Canvas#setHeight(width)
-
Sets the height of the canvas.
Parameters:
Name Type Description width
number the height. -
xrx.canvas.Canvas#setWidth(width)
-
Sets the width of the canvas.
Parameters:
Name Type Description width
number the width. -
xrx.canvas.Canvas#startDrawing()
-
Starts drawing this canvas.