public class Java2DRenderer extends AnimationLoopRenderer
framerate, scaling| Constructor and Description |
|---|
Java2DRenderer(ScaleStrategy scaling,
int framerate) |
| Modifier and Type | Method and Description |
|---|---|
void |
drawBackground(ColorRGB backgroundColor) |
void |
drawImage(Image image,
int x,
int y,
Transform transform) |
void |
drawPolygon(Polygon polygon,
ColorRGB color,
Transform transform) |
void |
drawRect(Rect rect,
ColorRGB color,
Transform transform) |
protected InputDevice |
getInputDevice() |
MediaLoader |
getMediaLoader() |
protected Rect |
getScreenBounds() |
java.awt.image.BufferedImage |
getWindowIcon() |
java.lang.String |
getWindowTitle() |
void |
initialize() |
void |
setScaleStrategy(ScaleStrategy scaleStrategy) |
void |
setWindowIcon(java.awt.image.BufferedImage windowIcon) |
void |
setWindowTitle(java.lang.String windowTitle) |
protected boolean |
shouldSyncFrames()
If this method returns true, the renderer is responsible for keeping
frame updates synchronized with the targeted framerate.
|
void |
terminate() |
drawText, getCanvasHeight, getCanvasWidth, getFrameTime, getScaleStrategy, getStats, getTargetFramerate, performFrameUpdate, registerCallback, unregisterCallbackclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdrawSpritepublic Java2DRenderer(ScaleStrategy scaling, int framerate)
public void initialize()
public void terminate()
public void drawBackground(ColorRGB backgroundColor)
protected boolean shouldSyncFrames()
AnimationLoopRendererIf this method returns false, the underlying platform is responsible for synchronizing frames, and in these cases the renderer will still adapt the number of frame updates versus the number of frame renders, but it will not sleep to slow down the animation loop.
shouldSyncFrames in class AnimationLoopRendererpublic MediaLoader getMediaLoader()
protected Rect getScreenBounds()
getScreenBounds in class AnimationLoopRendererprotected InputDevice getInputDevice()
getInputDevice in class AnimationLoopRendererpublic void setScaleStrategy(ScaleStrategy scaleStrategy)
public void setWindowTitle(java.lang.String windowTitle)
public java.lang.String getWindowTitle()
public void setWindowIcon(java.awt.image.BufferedImage windowIcon)
public java.awt.image.BufferedImage getWindowIcon()