public class AndroidMini2DxGame
extends Activity
Modifier and Type | Field and Description |
---|---|
protected com.badlogic.gdx.ApplicationLogger |
applicationLogger |
protected AndroidMini2DxAudio |
audio |
protected AndroidClipboard |
clipboard |
protected com.badlogic.gdx.utils.Array<java.lang.Runnable> |
executedRunnables |
protected AndroidFiles |
files |
protected boolean |
firstResume |
protected AndroidMini2DxGraphics |
graphics |
Handler |
handler |
protected boolean |
hideStatusBar |
protected AndroidInput |
input |
protected com.badlogic.gdx.utils.SnapshotArray<com.badlogic.gdx.LifecycleListener> |
lifecycleListeners |
protected ApplicationListener |
listener |
protected int |
logLevel |
protected AndroidNet |
net |
protected com.badlogic.gdx.utils.Array<java.lang.Runnable> |
runnables |
protected boolean |
useImmersiveMode |
Constructor and Description |
---|
AndroidMini2DxGame() |
Modifier and Type | Method and Description |
---|---|
void |
addAndroidEventListener(AndroidEventListener listener)
Adds an event listener for Android specific event such as
onActivityResult(...).
|
void |
addLifecycleListener(com.badlogic.gdx.LifecycleListener listener) |
protected FrameLayout.LayoutParams |
createLayoutParams() |
protected void |
createWakeLock(boolean use) |
void |
debug(java.lang.String tag,
java.lang.String message) |
void |
debug(java.lang.String tag,
java.lang.String message,
java.lang.Throwable exception) |
void |
error(java.lang.String tag,
java.lang.String message) |
void |
error(java.lang.String tag,
java.lang.String message,
java.lang.Throwable exception) |
void |
exit() |
ApplicationListener |
getApplicationListener() |
com.badlogic.gdx.ApplicationLogger |
getApplicationLogger() |
Window |
getApplicationWindow() |
com.badlogic.gdx.Audio |
getAudio() |
com.badlogic.gdx.utils.Clipboard |
getClipboard() |
Context |
getContext() |
com.badlogic.gdx.utils.Array<java.lang.Runnable> |
getExecutedRunnables() |
com.badlogic.gdx.Files |
getFiles() |
com.badlogic.gdx.Graphics |
getGraphics() |
Handler |
getHandler() |
AndroidInput |
getInput() |
long |
getJavaHeap() |
com.badlogic.gdx.utils.SnapshotArray<com.badlogic.gdx.LifecycleListener> |
getLifecycleListeners() |
int |
getLogLevel() |
long |
getNativeHeap() |
com.badlogic.gdx.Net |
getNet() |
com.badlogic.gdx.Preferences |
getPreferences(java.lang.String name) |
com.badlogic.gdx.utils.Array<java.lang.Runnable> |
getRunnables() |
ApplicationType |
getType() |
int |
getVersion() |
protected void |
hideStatusBar(boolean hide) |
void |
initialize(ApplicationListener listener,
AndroidMini2DxConfig config)
This method has to be called in the
Activity#onCreate(Bundle) method. |
void |
initialize(GameContainer game,
AndroidMini2DxConfig config)
This method has to be called in the
Activity#onCreate(Bundle) method. |
View |
initializeForView(ApplicationListener listener,
AndroidMini2DxConfig config)
This method has to be called in the
Activity#onCreate(Bundle) method. |
View |
initializeForView(GameContainer game,
AndroidMini2DxConfig config)
This method has to be called in the
Activity#onCreate(Bundle) method. |
void |
log(java.lang.String tag,
java.lang.String message) |
void |
log(java.lang.String tag,
java.lang.String message,
java.lang.Throwable exception) |
protected void |
onActivityResult(int requestCode,
int resultCode,
Intent data) |
void |
onConfigurationChanged(Configuration config) |
protected void |
onDestroy() |
protected void |
onPause() |
protected void |
onResume() |
void |
onWindowFocusChanged(boolean hasFocus) |
void |
postRunnable(java.lang.Runnable runnable) |
void |
removeAndroidEventListener(AndroidEventListener listener)
Removes an event listener for Android specific event such as
onActivityResult(...).
|
void |
removeLifecycleListener(com.badlogic.gdx.LifecycleListener listener) |
void |
setApplicationLogger(com.badlogic.gdx.ApplicationLogger applicationLogger) |
void |
setLogLevel(int logLevel) |
void |
useImmersiveMode(boolean use) |
protected AndroidMini2DxGraphics graphics
protected AndroidInput input
protected AndroidMini2DxAudio audio
protected AndroidFiles files
protected AndroidNet net
protected AndroidClipboard clipboard
protected ApplicationListener listener
public Handler handler
protected boolean firstResume
protected final com.badlogic.gdx.utils.Array<java.lang.Runnable> runnables
protected final com.badlogic.gdx.utils.Array<java.lang.Runnable> executedRunnables
protected final com.badlogic.gdx.utils.SnapshotArray<com.badlogic.gdx.LifecycleListener> lifecycleListeners
protected int logLevel
protected com.badlogic.gdx.ApplicationLogger applicationLogger
protected boolean useImmersiveMode
protected boolean hideStatusBar
public void initialize(GameContainer game, AndroidMini2DxConfig config)
Activity#onCreate(Bundle)
method.
It sets up all the things necessary to get input, render via OpenGL and so
on. You can configure other aspects of the application with the rest of the
fields in the AndroidMini2DxConfig
instance.game
- the GameContainer
implementing the game logicconfig
- the AndroidMini2DxConfig
, defining various settings of the
application (use accelerometer, etc.).public void initialize(ApplicationListener listener, AndroidMini2DxConfig config)
Activity#onCreate(Bundle)
method.
It sets up all the things necessary to get input, render via OpenGL and so
on. You can configure other aspects of the application with the rest of the
fields in the AndroidMini2DxConfig
instance.listener
- the ApplicationListener
implementing the program logicconfig
- the AndroidMini2DxConfig
, defining various settings of the
application (use accelerometer, etc.).public View initializeForView(GameContainer game, AndroidMini2DxConfig config)
Activity#onCreate(Bundle)
method.
It sets up all the things necessary to get input, render via OpenGL and so
on. Uses a default AndroidApplicationConfiguration
.
Note: you have to add the returned view to your layout!
game
- the GameContainer
implementing the game logicconfig
- the AndroidMini2DxConfig
, defining various settings of the
application (use accelerometer, etc.).public View initializeForView(ApplicationListener listener, AndroidMini2DxConfig config)
Activity#onCreate(Bundle)
method.
It sets up all the things necessary to get input, render via OpenGL and so
on. You can configure other aspects of the application with the rest of the
fields in the AndroidApplicationConfiguration
instance.
Note: you have to add the returned view to your layout!
listener
- the ApplicationListener
implementing the program logicconfig
- the AndroidApplicationConfiguration
, defining various
settings of the application (use accelerometer, etc.).protected FrameLayout.LayoutParams createLayoutParams()
protected void createWakeLock(boolean use)
protected void hideStatusBar(boolean hide)
public void onWindowFocusChanged(boolean hasFocus)
public void useImmersiveMode(boolean use)
protected void onPause()
protected void onResume()
protected void onDestroy()
public ApplicationListener getApplicationListener()
public com.badlogic.gdx.Audio getAudio()
public com.badlogic.gdx.Files getFiles()
public com.badlogic.gdx.Graphics getGraphics()
public AndroidInput getInput()
public com.badlogic.gdx.Net getNet()
public ApplicationType getType()
public int getVersion()
public long getJavaHeap()
public long getNativeHeap()
public com.badlogic.gdx.Preferences getPreferences(java.lang.String name)
public com.badlogic.gdx.utils.Clipboard getClipboard()
public void postRunnable(java.lang.Runnable runnable)
public void onConfigurationChanged(Configuration config)
public void exit()
public void debug(java.lang.String tag, java.lang.String message)
public void debug(java.lang.String tag, java.lang.String message, java.lang.Throwable exception)
public void log(java.lang.String tag, java.lang.String message)
public void log(java.lang.String tag, java.lang.String message, java.lang.Throwable exception)
public void error(java.lang.String tag, java.lang.String message)
public void error(java.lang.String tag, java.lang.String message, java.lang.Throwable exception)
public void setLogLevel(int logLevel)
public int getLogLevel()
public void setApplicationLogger(com.badlogic.gdx.ApplicationLogger applicationLogger)
public com.badlogic.gdx.ApplicationLogger getApplicationLogger()
public void addLifecycleListener(com.badlogic.gdx.LifecycleListener listener)
public void removeLifecycleListener(com.badlogic.gdx.LifecycleListener listener)
protected void onActivityResult(int requestCode, int resultCode, Intent data)
public void addAndroidEventListener(AndroidEventListener listener)
public void removeAndroidEventListener(AndroidEventListener listener)
public Context getContext()
public com.badlogic.gdx.utils.Array<java.lang.Runnable> getRunnables()
public com.badlogic.gdx.utils.Array<java.lang.Runnable> getExecutedRunnables()
public com.badlogic.gdx.utils.SnapshotArray<com.badlogic.gdx.LifecycleListener> getLifecycleListeners()
public Window getApplicationWindow()
public Handler getHandler()