public abstract class GameContainer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Graphics |
graphics |
protected int |
height |
static float |
MAXIMUM_DELTA |
static int |
TARGET_FPS |
protected int |
width |
Constructor and Description |
---|
GameContainer() |
Modifier and Type | Method and Description |
---|---|
void |
addResizeListener(GameResizeListener listener) |
com.badlogic.gdx.scenes.scene2d.Stage |
createStage(com.badlogic.gdx.utils.viewport.Viewport viewport)
Creates a LibGDX using the internal
Graphics context |
void |
dispose() |
int |
getHeight() |
int |
getWidth() |
abstract void |
initialise()
Initialse the game
|
abstract void |
interpolate(float alpha)
Interpolate the game state
|
abstract void |
onPause() |
abstract void |
onResume() |
protected void |
postinit()
Internal post-initialisation code
|
protected void |
preinit(Graphics g)
Internal pre-initialisation code
|
void |
removeResizeListener(GameResizeListener listener) |
void |
render() |
abstract void |
render(Graphics g)
Render the game
|
void |
resize(int width,
int height) |
void |
start(Graphics g) |
abstract void |
update(float delta)
Update the game
|
public static final int TARGET_FPS
public static final float MAXIMUM_DELTA
protected int width
protected int height
protected Graphics graphics
public abstract void initialise()
public abstract void update(float delta)
delta
- The time in seconds since the last updatepublic abstract void interpolate(float alpha)
alpha
- The alpha value to use during interpolationpublic abstract void render(Graphics g)
g
- The Graphics
context available for renderingpublic abstract void onPause()
public abstract void onResume()
public void render()
public void resize(int width, int height)
public com.badlogic.gdx.scenes.scene2d.Stage createStage(com.badlogic.gdx.utils.viewport.Viewport viewport)
Graphics
contextviewport
- The Viewport
to be appliedStage
protected void preinit(Graphics g)
protected void postinit()
public void start(Graphics g)
public void dispose()
public void addResizeListener(GameResizeListener listener)
public void removeResizeListener(GameResizeListener listener)
public int getWidth()
public int getHeight()