Package fr.formiko.kokcinelo
Class App
java.lang.Object
com.badlogic.gdx.Game
fr.formiko.kokcinelo.App
- All Implemented Interfaces:
com.badlogic.gdx.ApplicationListener
public class App
extends com.badlogic.gdx.Game
Main class that represent the App & call other Screens.
It call MainMenuScreen
- Since:
- 0.1
- Version:
- 2.4
- See Also:
-
Game
-
Field Summary
FieldsModifier and TypeFieldDescriptioncom.badlogic.gdx.graphics.g2d.SpriteBatchstatic final com.badlogic.gdx.graphics.Colorstatic final com.badlogic.gdx.graphics.Colorstatic final com.badlogic.gdx.graphics.Colorstatic final com.badlogic.gdx.graphics.ColorFields inherited from class com.badlogic.gdx.Game
screen -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Main function call when App is created.voiddispose()call dispose function of item that need to be dispose so that App close itself.voidexit(int code) static com.badlogic.gdx.graphics.ColorgetColorFromPercent(int percent) Return color depending of percent.static StringReturn current time in standardized format.static StringReturn current version.static Stringstatic KOptionsMapstatic booleanisPlayableLevel(String levelId) static booleanstatic voidSave or print log using Gdx.app settings.static voidSave or print log using Gdx.app settings.static voidSave or print log using Gdx.app settings.static voidSave or print log using Gdx.app settings.voidplayEndGameSound(boolean haveWin) Play the end game sound.static voidPlay the given sound with default volume & default pan.static voidPlay the given sound.voidrender()call render function of sub screensstatic voidsaveSizeInOptions(int width, int height) static voidsetLanguage(String language) Set language & update translation list.static voidsetWithCloseButton(boolean withCloseButton) voidStart a new Game on this app in GUI.Methods inherited from class com.badlogic.gdx.Game
getScreen, pause, resize, resume, setScreen
-
Field Details
-
batch
public com.badlogic.gdx.graphics.g2d.SpriteBatch batch -
PLAYABLE_LEVELS
-
SUPPORTED_LANGUAGES
-
LANGUAGES_NAMES
-
LANGUAGES_PERCENTAGES
-
STARS_SCORES
-
BLUE_BACKGROUND
public static final com.badlogic.gdx.graphics.Color BLUE_BACKGROUND -
GREEN
public static final com.badlogic.gdx.graphics.Color GREEN -
SKY_BLUE_1
public static final com.badlogic.gdx.graphics.Color SKY_BLUE_1 -
SKY_BLUE_2
public static final com.badlogic.gdx.graphics.Color SKY_BLUE_2
-
-
Constructor Details
-
App
-
App
public App()
-
-
Method Details
-
isWithCloseButton
public static boolean isWithCloseButton() -
setWithCloseButton
public static void setWithCloseButton(boolean withCloseButton) -
getDataMap
-
getOptionsMap
-
getLanguage
-
saveSizeInOptions
public static void saveSizeInOptions(int width, int height) -
setLanguage
Set language & update translation list.- Parameters:
language- language to switch to
-
create
public void create()Main function call when App is created. It call MainMenuScreen.- See Also:
-
ApplicationListener.create()
-
startNewGame
public void startNewGame()Start a new Game on this app in GUI. -
render
public void render()call render function of sub screens- Specified by:
renderin interfacecom.badlogic.gdx.ApplicationListener- Overrides:
renderin classcom.badlogic.gdx.Game- See Also:
-
Game.render()
-
dispose
public void dispose()call dispose function of item that need to be dispose so that App close itself.- Specified by:
disposein interfacecom.badlogic.gdx.ApplicationListener- Overrides:
disposein classcom.badlogic.gdx.Game- See Also:
-
Game.dispose()
-
exit
public void exit(int code) -
isPlayableLevel
-
playSound
Play the given sound. Sound can be play many times & at same time.- Parameters:
fileName- name of the sound filevolume- volume of the sound in [0, 1]pan- left rigth ballance of the sound file in [-1, 1]
-
playSound
Play the given sound with default volume & default pan. Sound can be play many times & at same time.- Parameters:
fileName- name of the sound file
-
playEndGameSound
public void playEndGameSound(boolean haveWin) Play the end game sound. Sound can be play many times & at same time.- Parameters:
haveWin- the sound is different if game is win or lost
-
log
Save or print log using Gdx.app settings.- Parameters:
logLevel- int value from 0 (debug) to 4 (error) to represent gravity of logtag- tag of the logmessage- message of the logexception- exception that have been catch
-
log
Save or print log using Gdx.app settings.- Parameters:
logLevel- int value from 0 (debug) to 4 (error) to represent gravity of logtag- tag of the logmessage- message of the log
-
log
Save or print log using Gdx.app settings.- Parameters:
logLevel- int value from 0 (debug) to 4 (error) to represent gravity of logmessage- message of the log
-
log
Save or print log using Gdx.app settings.- Parameters:
message- message of the log
-
getCurrentTime
Return current time in standardized format.- Returns:
- current time in standardized format
-
getCurrentVersion
Return current version. If current version is unknown, return "...". Current version is unknown if version.md file haven't been save in .jar file.- Returns:
- current version
-
getColorFromPercent
public static com.badlogic.gdx.graphics.Color getColorFromPercent(int percent) Return color depending of percent.- Parameters:
percent- score percent [0;100+]- Returns:
- color
-