public abstract class GameContainer
extends java.lang.Object
implements com.badlogic.gdx.Screen
Modifier and Type | Field and Description |
---|---|
protected Graphics |
graphics |
protected int |
height |
protected com.badlogic.gdx.graphics.glutils.ShapeRenderer |
shapeRenderer |
protected com.badlogic.gdx.graphics.g2d.SpriteBatch |
spriteBatch |
protected int |
width |
Constructor and Description |
---|
GameContainer() |
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
int |
getHeight() |
int |
getWidth() |
void |
hide() |
abstract void |
initialise()
Initialse the game
|
abstract void |
interpolate(float alpha)
Interpolate the game state
|
protected void |
postinit()
Internal post-initialisation code
|
protected void |
preinit()
Internal pre-initialisation code
|
void |
render(float delta) |
abstract void |
render(Graphics g)
Render the game
|
void |
resize(int width,
int height) |
void |
show() |
abstract void |
update(float delta)
Update the game
|
protected int width
protected int height
protected Graphics graphics
protected com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch
protected com.badlogic.gdx.graphics.glutils.ShapeRenderer shapeRenderer
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 void render(float delta)
render
in interface com.badlogic.gdx.Screen
public void resize(int width, int height)
resize
in interface com.badlogic.gdx.Screen
protected void preinit()
protected void postinit()
public void show()
show
in interface com.badlogic.gdx.Screen
public void dispose()
dispose
in interface com.badlogic.gdx.Screen
public void hide()
hide
in interface com.badlogic.gdx.Screen
public int getWidth()
public int getHeight()