public abstract class AnimationLoopRenderer extends java.lang.Object implements Renderer, RenderContext
| Modifier and Type | Field and Description |
|---|---|
protected int |
framerate |
protected ScaleStrategy |
scaling |
| Constructor and Description |
|---|
AnimationLoopRenderer(ScaleStrategy scaling,
int framerate) |
| Modifier and Type | Method and Description |
|---|---|
void |
drawText(java.lang.String text,
BitmapFont font,
int x,
int y)
Implements drawing text by drawing each of the characters as an image
using the specified bitmap font.
|
int |
getCanvasHeight() |
int |
getCanvasWidth() |
float |
getFrameTime() |
protected abstract InputDevice |
getInputDevice() |
ScaleStrategy |
getScaleStrategy() |
protected abstract Rect |
getScreenBounds() |
RenderStats |
getStats() |
int |
getTargetFramerate() |
protected void |
performFrameUpdate()
Performs a frame update.
|
void |
registerCallback(RenderCallback callback) |
protected abstract boolean |
shouldSyncFrames()
If this method returns true, the renderer is responsible for keeping
frame updates synchronized with the targeted framerate.
|
void |
unregisterCallback(RenderCallback callback) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMediaLoader, initialize, terminatedrawBackground, drawImage, drawRect, drawSpriteprotected ScaleStrategy scaling
protected int framerate
public AnimationLoopRenderer(ScaleStrategy scaling, int framerate)
protected void performFrameUpdate()
protected abstract boolean shouldSyncFrames()
If 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.
public int getCanvasWidth()
getCanvasWidth in interface RenderContextgetCanvasWidth in interface Rendererpublic int getCanvasHeight()
getCanvasHeight in interface RenderContextgetCanvasHeight in interface Rendererprotected abstract Rect getScreenBounds()
public void drawText(java.lang.String text,
BitmapFont font,
int x,
int y)
drawText in interface RenderContextpublic ScaleStrategy getScaleStrategy()
getScaleStrategy in interface Rendererpublic int getTargetFramerate()
getTargetFramerate in interface Rendererpublic float getFrameTime()
protected abstract InputDevice getInputDevice()
public RenderStats getStats()
public void registerCallback(RenderCallback callback)
registerCallback in interface Rendererpublic void unregisterCallback(RenderCallback callback)
unregisterCallback in interface Renderer