Package sk.tuke.kpi.gamelib
Class GameApplication
- java.lang.Object
-
- sk.tuke.kpi.gamelib.GameApplication
-
-
Field Summary
Fields Modifier and Type Field Description static @NotNull com.badlogic.gdx.assets.AssetManager
assets
static int
STATUS_LINE_OFFSET
-
Constructor Summary
Constructors Constructor Description GameApplication(@NotNull Backend backend)
GameApplication(@NotNull WindowSetup windowSetup, @NotNull Backend backend)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addScene(@NotNull Scene scene)
Adds a anew scene to the game.void
clearScreen()
Clears the game's screen.void
clearScreen(@NotNull Color color)
Clears the game's screen with specified color.@NotNull Scene
getCurrentScene()
int
getFramesPerSecond()
@NotNull Input
getInput()
Gets game's global input processor that is active in all scenes.@NotNull Overlay
getOverlay()
@NotNull Scene
getSceneByName(@NotNull java.lang.String name)
Gets a scene with given name.@NotNull WindowSetup
getWindowSetup()
@Nullable ActorContainer<?>
peekActorContainer()
Gets the last container pushed to actor containers stack.@Nullable ActorContainer<?>
popActorContainer()
Pops the last container from actor containers stack.void
pushActorContainer(@NotNull ActorContainer<?> container)
Pushes a newcontainer
to the stack of actor containers.void
setCurrentSceneByName(@NotNull java.lang.String name)
Switches the currently shown scene to another already registered scene with the given name.void
start()
Starts the game.void
stop()
Stops the game.
-
-
-
Field Detail
-
STATUS_LINE_OFFSET
public static final int STATUS_LINE_OFFSET
- See Also:
- Constant Field Values
-
assets
@NotNull public static final @NotNull com.badlogic.gdx.assets.AssetManager assets
-
-
Constructor Detail
-
GameApplication
public GameApplication(@NotNull @NotNull Backend backend)
-
GameApplication
public GameApplication(@NotNull @NotNull WindowSetup windowSetup, @NotNull @NotNull Backend backend)
-
-
Method Detail
-
getWindowSetup
@NotNull public @NotNull WindowSetup getWindowSetup()
- Specified by:
getWindowSetup
in interfaceGame
- Returns:
- game window setup data
-
getFramesPerSecond
public int getFramesPerSecond()
- Specified by:
getFramesPerSecond
in interfaceGame
- Returns:
- game FPS
-
getCurrentScene
@NotNull public @NotNull Scene getCurrentScene()
- Specified by:
getCurrentScene
in interfaceGame
- Returns:
- currently shown scene
-
getOverlay
@NotNull public @NotNull Overlay getOverlay()
- Specified by:
getOverlay
in interfaceGame
- Returns:
- topmost game overlay;
-
addScene
public void addScene(@NotNull @NotNull Scene scene)
Description copied from interface:Game
Adds a anew scene to the game.
-
getSceneByName
@NotNull public @NotNull Scene getSceneByName(@NotNull @NotNull java.lang.String name)
Description copied from interface:Game
Gets a scene with given name.- Specified by:
getSceneByName
in interfaceGame
- Parameters:
name
- scene name to look up- Returns:
- scene with the given name
-
setCurrentSceneByName
public void setCurrentSceneByName(@NotNull @NotNull java.lang.String name)
Description copied from interface:Game
Switches the currently shown scene to another already registered scene with the given name.- Specified by:
setCurrentSceneByName
in interfaceGame
- Parameters:
name
- name of the scene to switch to
-
start
public void start()
Description copied from interface:Game
Starts the game. Usually start the main game loop.
-
stop
public void stop()
Description copied from interface:Game
Stops the game.
-
clearScreen
public void clearScreen()
Description copied from interface:Game
Clears the game's screen.- Specified by:
clearScreen
in interfaceGame
-
clearScreen
public void clearScreen(@NotNull @NotNull Color color)
Description copied from interface:Game
Clears the game's screen with specified color.- Specified by:
clearScreen
in interfaceGame
-
pushActorContainer
public void pushActorContainer(@NotNull @NotNull ActorContainer<?> container)
Description copied from interface:Game
Pushes a newcontainer
to the stack of actor containers.- Specified by:
pushActorContainer
in interfaceGame
-
popActorContainer
@Nullable public @Nullable ActorContainer<?> popActorContainer()
Description copied from interface:Game
Pops the last container from actor containers stack.- Specified by:
popActorContainer
in interfaceGame
- Returns:
- the last added container
-
peekActorContainer
@Nullable public @Nullable ActorContainer<?> peekActorContainer()
Description copied from interface:Game
Gets the last container pushed to actor containers stack.- Specified by:
peekActorContainer
in interfaceGame
- Returns:
- the last added container
-
getInput
@NotNull public @NotNull Input getInput()
Description copied from interface:Game
Gets game's global input processor that is active in all scenes.- Specified by:
getInput
in interfaceGame
- Returns:
- global input processor
- See Also:
Scene.getInput()
-
-