Class PowerCanvas
Defined in: gamelib.js.
Constructor Attributes | Constructor Name and Description |
---|---|
PowerCanvas provides a convenient wrapper for working with Context2d.
|
Method Attributes | Method Name and Description |
---|---|
fillCircle(x, y, radius, color)
Fills a circle at the specified position with the specified
radius and color.
|
|
fillRect(x, y, width, height)
Fills a rectangle with the current fillColor
at the specified position with the specified
width and height
|
|
withTransform(matrix, block)
Passes this canvas to the block with the given matrix transformation
applied.
|
Method Detail
fillCircle(x, y, radius, color)
Fills a circle at the specified position with the specified
radius and color.
- Returns:
- this
- See:
- PowerCanvas#fillColor
fillRect(x, y, width, height)
Fills a rectangle with the current fillColor
at the specified position with the specified
width and height
- Returns:
- this
- See:
- PowerCanvas#fillColor
withTransform(matrix, block)
Passes this canvas to the block with the given matrix transformation
applied. All drawing methods called within the block will draw
into the canvas with the transformation applied. The transformation
is removed at the end of the block, even if the block throws an error.
- Returns:
- this