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, setBackground
public void draw()
Surface
public void renderSprite(Sprite sprite)
Surface
renderSprite
in class Surface
sprite
- the sprite to be renderedpublic void setCursor(Sprite sprite, String property)
Surface
public void setViewBox(double x, double y, double width, double height)
Surface
setViewBox
in class Surface
x
- 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)
Surface
Copyright © 2015. All rights reserved.