public class Canvas2d extends Surface
| Constructor and Description |
|---|
Canvas2d() |
| Modifier and Type | Method and Description |
|---|---|
void |
draw()
Renders the surface to the DOM as well as any sprites already added.
|
void |
renderSprite(Sprite sprite)
Renders the given sprite to the DOM.
|
void |
setCursor(Sprite sprite,
String property)
Sets the cursor property for the given sprite.
|
void |
setHeight(int height)
Sets the height of the surface.
|
void |
setViewBox(double x,
double y,
double width,
double height)
Sets the view box of the surface.
|
void |
setWidth(int width)
Sets the width of the surface.
|
add, addGradient, clear, create, create, deleteSprite, getBBox, getComponent, getHeight, getSprites, getSurfaceElement, getWidth, setBackgroundpublic void draw()
Surfacepublic void renderSprite(Sprite sprite)
SurfacerenderSprite in class Surfacesprite - the sprite to be renderedpublic void setCursor(Sprite sprite, String property)
Surfacepublic void setViewBox(double x,
double y,
double width,
double height)
SurfacesetViewBox in class Surfacex - the x coordinate of the viewboxy - the y coordinate of the viewboxwidth - the width of the viewboxheight - the height of the viewboxpublic void setWidth(int width)
SurfaceCopyright © 2014. All Rights Reserved.