public final class POffscreenCanvas extends Object implements PComponent
| Constructor and Description |
|---|
POffscreenCanvas(int width,
int height)
Create a new offscreen canvas the specified width and height.
|
| Modifier and Type | Method and Description |
|---|---|
Color |
getBackground()
Return the background color for this offscreen canvas.
|
PCamera |
getCamera()
Return the camera for this offscreen canvas.
|
int |
getRenderQuality()
Return the render quality hint for this offscreen canvas.
|
PRoot |
getRoot()
Return the root node of the scene graph for this offscreen canvas.
|
boolean |
isOpaque()
Return true if this offscreen canvas is opaque.
|
void |
paintImmediately()
Sends a repaint notification the repaint manager if PComponent is not
already painting immediately.
|
void |
popCursor()
Pops the topmost cursor from the stack and sets it as the current one.
|
void |
pushCursor(Cursor cursor)
Pushes the given cursor onto the cursor stack and sets the current cursor
to the one provided.
|
void |
render(Graphics2D graphics)
Render this offscreen canvas to the specified graphics.
|
void |
repaint(PBounds repaintBounds)
Called to notify PComponent that given bounds need repainting.
|
void |
setBackground(Color backgroundColor)
Set the background color for this offscreen canvas to
backgroundColor. |
void |
setCamera(PCamera camera)
Set the camera for this offscreen canvas to
camera. |
void |
setInteracting(boolean interacting)
Sets whether the component is currently being interacted with.
|
void |
setOpaque(boolean opaque)
Set to true if this offscreen canvas is opaque.
|
void |
setRenderQuality(int renderQuality)
Set the render quality hint for this offscreen canvas to
renderQuality. |
public POffscreenCanvas(int width,
int height)
width - width of this offscreen canvas, must be at least zeroheight - height of this offscreen canvas, must be at least zeropublic void render(Graphics2D graphics)
graphics - graphics to render this offscreen canvas to, must not be nullpublic void setCamera(PCamera camera)
camera.camera - camera for this offscreen canvaspublic PCamera getCamera()
public void setRenderQuality(int renderQuality)
renderQuality.renderQuality - render quality hint, must be one of
PPaintContext.HIGH_QUALITY_RENDERING or
PPaintContext.LOW_QUALITY_RENDERINGpublic int getRenderQuality()
public void paintImmediately()
paintImmediately in interface PComponentpublic void popCursor()
popCursor in interface PComponentpublic void pushCursor(Cursor cursor)
pushCursor in interface PComponentcursor - The cursor to set as the current one and pushpublic void repaint(PBounds repaintBounds)
repaint in interface PComponentrepaintBounds - bounds needing repaintpublic void setInteracting(boolean interacting)
setInteracting in interface PComponentinteracting - whether the component is currently being interacted
withpublic PRoot getRoot()
public boolean isOpaque()
false.public void setOpaque(boolean opaque)
opaque - true if this offscreen canvas is opaquepublic Color getBackground()
isOpaque()public void setBackground(Color backgroundColor)
backgroundColor.
If this offscreen canvas is opaque, the background color will be painted
before the contents of the scene are rendered.backgroundColor - background color for this offscreen canvasisOpaque()Copyright © 1995-2013 Piccolo2D. All Rights Reserved.