APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx

public abstract Class Game

extends Object
implements ApplicationListener
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.ApplicationListener

An ApplicationListener that delegates to a Screen. This allows an application to easily have multiple screens.

Screens are not disposed automatically. You must handle whether you want to keep screens around or dispose of them when another screen is set.

Field Summary

Modifier and TypeField and Description
protected Screen

Constructor Summary

AccessConstructor and Description
public
Game()

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Implements com.badlogic.gdx.ApplicationListener.dispose.

Called when the Application is destroyed.

public Screen
getScreen()

Returns: the currently active Screen.

public void
pause()

Implements com.badlogic.gdx.ApplicationListener.pause.

Called when the Application is paused, usually when it's not active or visible on-screen.

public void
render()

Implements com.badlogic.gdx.ApplicationListener.render.

Called when the Application should render itself.

public void
resize(int width, int height)

Implements com.badlogic.gdx.ApplicationListener.resize.

Called when the Application is resized.

public void
resume()

Implements com.badlogic.gdx.ApplicationListener.resume.

Called when the Application is resumed from a paused state, usually when it regains focus.

public void
setScreen(Screen
may be null
screen
)

Sets the current screen.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

screenback to summary
protected Screen screen

Constructor Detail

Gameback to summary
public Game()

Method Detail

disposeback to summary
public void dispose()

Implements com.badlogic.gdx.ApplicationListener.dispose.

Doc from com.badlogic.gdx.ApplicationListener.dispose.

Called when the Application is destroyed. Preceded by a call to pause().

Annotations
@Override
getScreenback to summary
public Screen getScreen()
Returns:Screen

the currently active Screen.

pauseback to summary
public void pause()

Implements com.badlogic.gdx.ApplicationListener.pause.

Doc from com.badlogic.gdx.ApplicationListener.pause.

Called when the Application is paused, usually when it's not active or visible on-screen. An Application is also paused before it is destroyed.

Annotations
@Override
renderback to summary
public void render()

Implements com.badlogic.gdx.ApplicationListener.render.

Doc from com.badlogic.gdx.ApplicationListener.render.

Called when the Application should render itself.

Annotations
@Override
resizeback to summary
public void resize(int width, int height)

Implements com.badlogic.gdx.ApplicationListener.resize.

Doc from com.badlogic.gdx.ApplicationListener.resize.

Called when the Application is resized. This can happen at any point during a non-paused state but will never happen before a call to create().

Annotations
@Override
resumeback to summary
public void resume()

Implements com.badlogic.gdx.ApplicationListener.resume.

Doc from com.badlogic.gdx.ApplicationListener.resume.

Called when the Application is resumed from a paused state, usually when it regains focus.

Annotations
@Override
setScreenback to summary
public void setScreen(Screen screen)

Sets the current screen. Screen#hide() is called on any old screen, and Screen#show() is called on the new screen, if any.

Parameters
screen:Screen

may be null