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 libGDXActor
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScreenController
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Creates a Screencontroller with a ScalingViewport which stretches the ScreenElements on resize -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(T screenElement, ControllerLayer layer) Adds the element with the specific layer to this controller, if it is not already added.void
boolean
Removes the element from this controller, if it is in this controller.void
update()
Methods inherited from class controller.AbstractController
add, addAll, addAll, clear, clearLayer, contains, forEach, isEmpty, iterator, size, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
spliterator
-
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 classAbstractController<T extends com.badlogic.gdx.scenes.scene2d.Actor & Removable>
-
process
- Specified by:
process
in classAbstractController<T extends com.badlogic.gdx.scenes.scene2d.Actor & Removable>
-
add
Description copied from class:AbstractController
Adds the element with the specific layer to this controller, if it is not already added.- Overrides:
add
in classAbstractController<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
Description copied from class:AbstractController
Removes the element from this controller, if it is in this controller.- Overrides:
remove
in classAbstractController<T extends com.badlogic.gdx.scenes.scene2d.Actor & Removable>
- Parameters:
e
- Element to remove.- Returns:
- true, if this was successful.
-