Class GameApplication

  • All Implemented Interfaces:
    Game

    public final class GameApplication
    extends java.lang.Object
    implements Game
    • Field Detail

      • 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 interface Game
        Returns:
        game window setup data
      • getFramesPerSecond

        public int getFramesPerSecond()
        Specified by:
        getFramesPerSecond in interface Game
        Returns:
        game FPS
      • getCurrentScene

        @NotNull
        public @NotNull Scene getCurrentScene()
        Specified by:
        getCurrentScene in interface Game
        Returns:
        currently shown scene
      • getOverlay

        @NotNull
        public @NotNull Overlay getOverlay()
        Specified by:
        getOverlay in interface Game
        Returns:
        topmost game overlay;
      • addScene

        public void addScene​(@NotNull
                             @NotNull Scene scene)
        Description copied from interface: Game
        Adds a anew scene to the game.
        Specified by:
        addScene in interface Game
        Parameters:
        scene - scene to add, with a unique name within 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 interface Game
        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 interface Game
        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.
        Specified by:
        start in interface Game
      • stop

        public void stop()
        Description copied from interface: Game
        Stops the game.
        Specified by:
        stop in interface Game
      • clearScreen

        public void clearScreen()
        Description copied from interface: Game
        Clears the game's screen.
        Specified by:
        clearScreen in interface Game
      • 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 interface Game
      • pushActorContainer

        public void pushActorContainer​(@NotNull
                                       @NotNull ActorContainer<?> container)
        Description copied from interface: Game
        Pushes a new container to the stack of actor containers.
        Specified by:
        pushActorContainer in interface Game
      • popActorContainer

        @Nullable
        public @Nullable ActorContainer<?> popActorContainer()
        Description copied from interface: Game
        Pops the last container from actor containers stack.
        Specified by:
        popActorContainer in interface Game
        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 interface Game
        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 interface Game
        Returns:
        global input processor
        See Also:
        Scene.getInput()