public class App
Main libgdx common application class. Created by platform specific launchers. Delegates actual rendering loop to Screens
For most games you can use subclass SimpleApp rather than App directly.
Modifier and Type | Class and Description |
---|---|
static class |
App.Companion |
Modifier and Type | Field and Description |
---|---|
static App.Companion |
Companion |
static App |
app
A static reference to the singleton Application
|
GameFactory |
controllerTest |
uk.co.electronstudio.sdl2gdx.SDL2ControllerManager |
controllers |
GameFactory |
screenTest1 |
GameFactory |
screenTest2 |
RetroShader |
shader |
Constructor and Description |
---|
App(Callback callback,
Logger logger,
ManualGC manualGC)
Main libgdx common application class. Created by platform specific launchers.
Delegates actual rendering loop to Screens
|
Modifier and Type | Method and Description |
---|---|
boolean |
anyKeyHit()
has any key or controller button or mouse recently been hit?
|
void |
applyMusicVolume(float volume) |
void |
clearEvents()
If player hit a key during game, you dont want that event to then take effect in the menu after the game,
so you call this.
|
void |
configureSessionWithPreSelectedInputDevice(GameSession session)
For some games, e.g. a standalone mobile game, you dont want the player to have
to hit a button to enter the game. This auto-adds the first player to the game
so he doesnt have to this.
|
void |
findIPaddress()
Tries to connect to AWS to get current IP address
in separate thread so wont slow down launch waiting for result
|
Player |
findPlayerAssociatedWithController(uk.co.electronstudio.sdl2gdx.SDL2Controller c) |
static App |
getApp()
A static reference to the singleton Application
|
Callback |
getCallback()
For setting maximum FPS,
|
uk.co.electronstudio.retrowar.network.Client |
getClient()
May be null if no Client
|
java.util.Map<uk.co.electronstudio.sdl2gdx.SDL2Controller,uk.co.electronstudio.retrowar.PlayerData> |
getControllerMappings() |
GameFactory |
getControllerTest() |
uk.co.electronstudio.sdl2gdx.SDL2ControllerManager |
getControllers() |
de.golfgl.gdxgameanalytics.GameAnalytics |
getGameAnalytics()
If you are using GameAnalytics service set this, otherwise null
|
uk.co.electronstudio.retrowar.music.ibxm.IBXMPlayer |
getIbxmPlayer() |
java.lang.String |
getIp()
Current IP address, if known. Else "unknown"
|
Logger |
getLogger()
If debug is on then logs are sent here,
|
ManualGC |
getManualGC()
GDX on iOS has very poor garbage collection.
|
boolean |
getMouseJustClicked() |
java.util.List<uk.co.electronstudio.retrowar.PlayerData> |
getPlayerData() |
java.util.List<uk.co.electronstudio.retrowar.Player> |
getPlayers() |
com.badlogic.gdx.Screen |
getSavedScreen() |
GameFactory |
getScreenTest1() |
GameFactory |
getScreenTest2() |
uk.co.electronstudio.retrowar.network.Server |
getServer()
May be null if no Server
|
RetroShader |
getShader() |
com.badlogic.gdx.Screen |
getTitle()
Title screen
|
java.lang.String |
getVersionString() |
void |
initialiseAndroid() |
void |
initialiseControllers()
Populates mappedControllers
|
void |
initialiseDesktop() |
void |
initialiseNetwork()
Setup network stuff, not currently working
|
void |
initialisePrefs()
Prefs can have behviour attached, like setting the screen resolution.
This triggers it for all of them, if they have it.
|
void |
initialiseShader() |
void |
initialiseSteam() |
void |
initializeInput() |
void |
loadPlayerData() |
void |
quit() |
void |
restoreSavedScreenAndDisposeCurrentScreen() |
void |
savePlayerData() |
static void |
setApp(App p)
A static reference to the singleton Application
|
void |
setClient(uk.co.electronstudio.retrowar.network.Client p)
May be null if no Client
|
void |
setControllerTest(GameFactory p) |
void |
setControllers(uk.co.electronstudio.sdl2gdx.SDL2ControllerManager p) |
void |
setFPS(int f)
Uses the Callback to set max FPS, if the platform supports it
|
void |
setGameAnalytics(de.golfgl.gdxgameanalytics.GameAnalytics p)
If you are using GameAnalytics service set this, otherwise null
|
void |
setIp(java.lang.String p)
Current IP address, if known. Else "unknown"
|
void |
setPlayerData(java.util.List<uk.co.electronstudio.retrowar.PlayerData> p) |
void |
setSavedScreen(com.badlogic.gdx.Screen p) |
void |
setScreenMode() |
void |
setScreenTest1(GameFactory p) |
void |
setScreenTest2(GameFactory p) |
void |
setServer(uk.co.electronstudio.retrowar.network.Server p)
May be null if no Server
|
void |
setShader(RetroShader p) |
void |
setTitle(com.badlogic.gdx.Screen p)
Title screen
|
void |
showTitleScreen() |
void |
submitAnalytics(java.lang.String s) |
void |
submitAnalyticsProgress(java.lang.String game,
java.lang.String level) |
void |
swapScreenAndDispose(com.badlogic.gdx.Screen screen)
Displays a new screen and disposes of the old one
|
void |
swapScreenAndSave(com.badlogic.gdx.Screen screen)
Displays a new screen and save old one for later
|
java.lang.String |
testSandbox()
For testing sandbox permissions, attempts to read property we shouldnt be allowed to read
|
public uk.co.electronstudio.sdl2gdx.SDL2ControllerManager controllers
public GameFactory controllerTest
public GameFactory screenTest1
public GameFactory screenTest2
public RetroShader shader
public static App app
A static reference to the singleton Application
public static App.Companion Companion
public App(Callback callback, Logger logger, ManualGC manualGC)
Main libgdx common application class. Created by platform specific launchers. Delegates actual rendering loop to Screens
For most games you can use subclass SimpleApp rather than App directly.
callback
- For setting maximum FPS, platform specificlogger
- If debug is on then logs are sent here, which may send them to screen, file orcloud.manualGC
- GDX on iOS has very poor garbage collection. Supply one of these to disableit and do your own GC. Otherwise null.callback
- For setting maximum FPS, platform specificlogger
- If debug is on then logs are sent here, which may send them to screen, file or
cloud.manualGC
- GDX on iOS has very poor garbage collection. Supply one of these to disable
it and do your own GC. Otherwise null.public com.badlogic.gdx.Screen getTitle()
Title screen
public void setTitle(com.badlogic.gdx.Screen p)
Title screen
public de.golfgl.gdxgameanalytics.GameAnalytics getGameAnalytics()
If you are using GameAnalytics service set this, otherwise null
public void setGameAnalytics(de.golfgl.gdxgameanalytics.GameAnalytics p)
If you are using GameAnalytics service set this, otherwise null
public uk.co.electronstudio.sdl2gdx.SDL2ControllerManager getControllers()
public void setControllers(uk.co.electronstudio.sdl2gdx.SDL2ControllerManager p)
public java.util.List<uk.co.electronstudio.retrowar.Player> getPlayers()
public Player findPlayerAssociatedWithController(uk.co.electronstudio.sdl2gdx.SDL2Controller c)
public java.util.List<uk.co.electronstudio.retrowar.PlayerData> getPlayerData()
public void setPlayerData(java.util.List<uk.co.electronstudio.retrowar.PlayerData> p)
public java.util.Map<uk.co.electronstudio.sdl2gdx.SDL2Controller,uk.co.electronstudio.retrowar.PlayerData> getControllerMappings()
public void loadPlayerData()
public void savePlayerData()
public void findIPaddress()
Tries to connect to AWS to get current IP address in separate thread so wont slow down launch waiting for result
public void setFPS(int f)
Uses the Callback to set max FPS, if the platform supports it
public void initialiseNetwork()
Setup network stuff, not currently working
public java.lang.String getIp()
Current IP address, if known. Else "unknown"
public void setIp(java.lang.String p)
Current IP address, if known. Else "unknown"
public uk.co.electronstudio.retrowar.network.Server getServer()
May be null if no Server
public void setServer(uk.co.electronstudio.retrowar.network.Server p)
May be null if no Server
public uk.co.electronstudio.retrowar.network.Client getClient()
May be null if no Client
public void setClient(uk.co.electronstudio.retrowar.network.Client p)
May be null if no Client
public GameFactory getControllerTest()
public void setControllerTest(GameFactory p)
public GameFactory getScreenTest1()
public void setScreenTest1(GameFactory p)
public GameFactory getScreenTest2()
public void setScreenTest2(GameFactory p)
public uk.co.electronstudio.retrowar.music.ibxm.IBXMPlayer getIbxmPlayer()
public RetroShader getShader()
public void setShader(RetroShader p)
public boolean anyKeyHit()
has any key or controller button or mouse recently been hit?
public java.lang.String testSandbox()
For testing sandbox permissions, attempts to read property we shouldnt be allowed to read
public boolean getMouseJustClicked()
public java.lang.String getVersionString()
public com.badlogic.gdx.Screen getSavedScreen()
public void setSavedScreen(com.badlogic.gdx.Screen p)
public void swapScreenAndDispose(com.badlogic.gdx.Screen screen)
Displays a new screen and disposes of the old one
public void swapScreenAndSave(com.badlogic.gdx.Screen screen)
Displays a new screen and save old one for later
public void restoreSavedScreenAndDisposeCurrentScreen()
public void showTitleScreen()
public void quit()
public void clearEvents()
If player hit a key during game, you dont want that event to then take effect in the menu after the game, so you call this.
public void initialisePrefs()
Prefs can have behviour attached, like setting the screen resolution. This triggers it for all of them, if they have it.
public void initialiseControllers()
Populates mappedControllers
public void initializeInput()
public void initialiseDesktop()
public void initialiseAndroid()
public void initialiseShader()
public void initialiseSteam()
public void setScreenMode()
public void submitAnalytics(java.lang.String s)
public void submitAnalyticsProgress(java.lang.String game, java.lang.String level)
public void configureSessionWithPreSelectedInputDevice(GameSession session)
For some games, e.g. a standalone mobile game, you dont want the player to have to hit a button to enter the game. This auto-adds the first player to the game so he doesnt have to this.
public void applyMusicVolume(float volume)
public Callback getCallback()
For setting maximum FPS,
platform specific
public Logger getLogger()
If debug is on then logs are sent here,
which may send them to screen, file orcloud.
public ManualGC getManualGC()
GDX on iOS has very poor garbage collection.
Supply one of these to disableit and do your own GC. Otherwise null.
public static App getApp()
A static reference to the singleton Application
public static void setApp(App p)
A static reference to the singleton Application