Package com.mygdx.game.UI
Class GameScreen
- java.lang.Object
-
- com.badlogic.gdx.ScreenAdapter
-
- com.mygdx.game.UI.Page
-
- com.mygdx.game.UI.GameScreen
-
- All Implemented Interfaces:
com.badlogic.gdx.Screen
public class GameScreen extends Page
-
-
Field Summary
Fields Modifier and Type Field Description static com.badlogic.gdx.scenes.scene2d.ui.Labelammostatic com.badlogic.gdx.scenes.scene2d.ui.Labeldoshstatic int[]durationsstatic com.badlogic.gdx.scenes.scene2d.ui.LabelhealthLabelstatic intmessage1static intmessage2static intnum_powersstatic com.badlogic.gdx.scenes.scene2d.ui.Labelpointsstatic float[]powersstatic com.badlogic.gdx.scenes.scene2d.ui.LabelquestDescstatic com.badlogic.gdx.scenes.scene2d.ui.LabelquestNamestatic inttimerstatic floatwarn1_timestatic floatwarn2_time
-
Constructor Summary
Constructors Constructor Description GameScreen(PirateGame parent, int id_map)Boots up the actual game: starts PhysicsManager, GameManager, EntityManager, loads texture atlases into ResourceManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidCreateActors()Draw UI elements showing player health, plunder, and ammo.voiddispose()disposed of all stuff it something is missing from this method you will get memory leaksvoidrender(float delta)Called every frame calls all other functions that need to be called every frame by rasing events and update methodsvoidresize(int width, int height)Resize camera, effectively setting the viewport to display game assets at pixel ratios other than 1:1.protected voidupdate()Update the UI with new values for health, quest status, etc.
-
-
-
Field Detail
-
healthLabel
public static com.badlogic.gdx.scenes.scene2d.ui.Label healthLabel
-
dosh
public static com.badlogic.gdx.scenes.scene2d.ui.Label dosh
-
ammo
public static com.badlogic.gdx.scenes.scene2d.ui.Label ammo
-
points
public static com.badlogic.gdx.scenes.scene2d.ui.Label points
-
questName
public static com.badlogic.gdx.scenes.scene2d.ui.Label questName
-
questDesc
public static com.badlogic.gdx.scenes.scene2d.ui.Label questDesc
-
powers
public static float[] powers
-
durations
public static int[] durations
-
warn1_time
public static float warn1_time
-
warn2_time
public static float warn2_time
-
timer
public static int timer
-
num_powers
public static int num_powers
-
message1
public static int message1
-
message2
public static int message2
-
-
Constructor Detail
-
GameScreen
public GameScreen(PirateGame parent, int id_map)
Boots up the actual game: starts PhysicsManager, GameManager, EntityManager, loads texture atlases into ResourceManager. Draws quest and control info.- Parameters:
parent- PirateGame UI screen containerid_map- the resource id of the tile map
-
-
Method Detail
-
render
public void render(float delta)
Called every frame calls all other functions that need to be called every frame by rasing events and update methods
-
dispose
public void dispose()
disposed of all stuff it something is missing from this method you will get memory leaks- Specified by:
disposein interfacecom.badlogic.gdx.Screen- Overrides:
disposein classcom.badlogic.gdx.ScreenAdapter
-
resize
public void resize(int width, int height)Resize camera, effectively setting the viewport to display game assets at pixel ratios other than 1:1.
-
update
protected void update()
Update the UI with new values for health, quest status, etc. also called once per frame but used for actors by my own convention
-
CreateActors
protected void CreateActors()
Draw UI elements showing player health, plunder, and ammo.- Specified by:
CreateActorsin classPage
-
-