Package com.mygdx.game.UI
Class Page
- java.lang.Object
-
- com.badlogic.gdx.ScreenAdapter
-
- com.mygdx.game.UI.Page
-
- All Implemented Interfaces:
com.badlogic.gdx.Screen
- Direct Known Subclasses:
EndScreen
,GameScreen
,MenuScreen
,PauseScreen
public abstract class Page extends com.badlogic.gdx.ScreenAdapter
Base class for UI screens. Contains and draws UI actors added in subclasses.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<com.badlogic.gdx.scenes.scene2d.Actor>
actors
-
Constructor Summary
Constructors Constructor Description Page(PirateGame parent)
Creates a Page Object
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
CreateActors()
void
hide()
Called once the page is hidden.void
render(float delta)
draws the stage and acts upon it also calls updatevoid
resize(int width, int height)
Called once the window is resized - updates constants and stagevoid
show()
Called once the page is show sets input handler and adds actorsprotected void
update()
Called once per frame
-
-
-
Constructor Detail
-
Page
public Page(PirateGame parent)
Creates a Page Object- Parameters:
parent
- The Game which this is attached to
-
-
Method Detail
-
CreateActors
protected abstract void CreateActors()
-
show
public void show()
Called once the page is show sets input handler and adds actors- Specified by:
show
in interfacecom.badlogic.gdx.Screen
- Overrides:
show
in classcom.badlogic.gdx.ScreenAdapter
-
render
public void render(float delta)
draws the stage and acts upon it also calls update- Specified by:
render
in interfacecom.badlogic.gdx.Screen
- Overrides:
render
in classcom.badlogic.gdx.ScreenAdapter
- Parameters:
delta
- delta time
-
hide
public void hide()
Called once the page is hidden. sets input handler to null and clears teh stage- Specified by:
hide
in interfacecom.badlogic.gdx.Screen
- Overrides:
hide
in classcom.badlogic.gdx.ScreenAdapter
-
resize
public void resize(int width, int height)
Called once the window is resized - updates constants and stage- Specified by:
resize
in interfacecom.badlogic.gdx.Screen
- Overrides:
resize
in classcom.badlogic.gdx.ScreenAdapter
- Parameters:
width
- new dim xheight
- new dom y
-
update
protected void update()
Called once per frame
-
-