public abstract class BaseApplication extends java.lang.Object implements com.badlogic.gdx.ApplicationListener, EventRouteListener
ScreenSwitch| Modifier and Type | Field and Description |
|---|---|
protected com.badlogic.gdx.graphics.g2d.PolygonSpriteBatch |
batch
Main batch of the game
|
protected FPSOverlay |
fpsOverlay
Renders fps to screen, if isDebug() == true
|
protected ResourceHandler |
resourceHandler
Main resource handler of the application
|
protected ScreenSwitch |
screenSwitch
Responsible for screen switching
|
protected Settings |
settings
Settings object
|
protected com.badlogic.gdx.utils.viewport.Viewport |
viewport
Main viewport of the application, can be overwritten per screen
|
| Constructor and Description |
|---|
BaseApplication() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
add(ScreenId id,
Screen screen)
|
void |
create() |
protected abstract ScreenId |
createLoadingScreen() |
protected abstract ScreenId |
createScreens()
In this method you should create and add all your screens (use
add(de.verygame.surface.screen.base.ScreenId, Screen)) for adding
screens. |
protected abstract Settings |
createSettings()
Here you can create some general settings for the application.
|
void |
dispose() |
protected ScreenId |
getActiveScreenId() |
protected void |
init() |
protected abstract void |
loadResources(ResourceHandler resourceHandler)
In this method you can load all your resources with help of the resource handler.
|
void |
pause() |
protected void |
postLoadResources(ResourceHandler res) |
protected void |
preLoadResources(ResourceHandler resourceHandler)
It's important to note, that the amount of resources loaded here have to be very small and you have to load it using
blocking methods like
ResourceHandler.waitFor(Resource). |
void |
render() |
void |
resize(int width,
int height) |
void |
resume() |
protected void |
setActive(ScreenId id)
Sets the screen active which is mapped to the given id.
|
protected ResourceHandler resourceHandler
protected com.badlogic.gdx.graphics.g2d.PolygonSpriteBatch batch
protected com.badlogic.gdx.utils.viewport.Viewport viewport
protected ScreenSwitch screenSwitch
protected FPSOverlay fpsOverlay
protected Settings settings
protected void add(ScreenId id, Screen screen)
ScreenSwitch.addScreen(de.verygame.surface.screen.base.ScreenId, de.verygame.surface.screen.base.Screen).id - id of the screenscreen - screenprotected void setActive(ScreenId id)
id - id of the screen you want to activateprotected ScreenId getActiveScreenId()
protected abstract ScreenId createScreens()
add(de.verygame.surface.screen.base.ScreenId, Screen)) for adding
screens.protected abstract Settings createSettings()
Settingsprotected abstract void loadResources(ResourceHandler resourceHandler)
resourceHandler.resourceHandler - equals to resourceHandlerpublic void create()
create in interface com.badlogic.gdx.ApplicationListenerprotected abstract ScreenId createLoadingScreen()
protected void init()
protected void postLoadResources(ResourceHandler res)
protected void preLoadResources(ResourceHandler resourceHandler)
ResourceHandler.waitFor(Resource).resourceHandler - Handler of the resourcespublic void render()
render in interface com.badlogic.gdx.ApplicationListenerpublic void resize(int width,
int height)
resize in interface com.badlogic.gdx.ApplicationListenerpublic void pause()
pause in interface com.badlogic.gdx.ApplicationListenerpublic void resume()
resume in interface com.badlogic.gdx.ApplicationListenerpublic void dispose()
dispose in interface com.badlogic.gdx.ApplicationListener