Package controller

Class ScreenController<T extends com.badlogic.gdx.scenes.scene2d.Actor & Removable>

java.lang.Object
controller.AbstractController<T>
controller.ScreenController<T>
Type Parameters:
T - A libGDX Actor that has also the removable property.
All Implemented Interfaces:
Iterable<T>

public class ScreenController<T extends com.badlogic.gdx.scenes.scene2d.Actor & Removable> extends AbstractController<T>
A class to manage Actor and Removables.

Provides methods for add, remove, update and reorder elements.

  • Field Details

    • stage

      protected com.badlogic.gdx.scenes.scene2d.Stage stage
  • Constructor Details

    • ScreenController

      public ScreenController(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Creates a Screencontroller with a ScalingViewport which stretches the ScreenElements on resize
      Parameters:
      batch - the batch which should be used to draw with
  • Method Details

    • update

      public void update()
      Overrides:
      update in class AbstractController<T extends com.badlogic.gdx.scenes.scene2d.Actor & Removable>
    • process

      public void process(T e)
      Specified by:
      process in class AbstractController<T extends com.badlogic.gdx.scenes.scene2d.Actor & Removable>
    • add

      public boolean add(T screenElement, ControllerLayer layer)
      Description copied from class: AbstractController
      Adds the element with the specific layer to this controller, if it is not already added.
      Overrides:
      add in class AbstractController<T extends com.badlogic.gdx.scenes.scene2d.Actor & Removable>
      Parameters:
      screenElement - Element to add.
      layer - Layer to add the element in.
      Returns:
      true, if this was successful.
    • remove

      public boolean remove(T e)
      Description copied from class: AbstractController
      Removes the element from this controller, if it is in this controller.
      Overrides:
      remove in class AbstractController<T extends com.badlogic.gdx.scenes.scene2d.Actor & Removable>
      Parameters:
      e - Element to remove.
      Returns:
      true, if this was successful.