com.TeamHEC.LocomotionCommotion.UI_Elements
Class GameScreenUI

java.lang.Object
  extended by com.TeamHEC.LocomotionCommotion.UI_Elements.GameScreenUI

public class GameScreenUI
extends java.lang.Object

Author:
Robert Precious

Field Summary
static com.badlogic.gdx.scenes.scene2d.ui.Label cardQuant
           
static com.badlogic.gdx.scenes.scene2d.ui.Label coalQuant
           
static com.badlogic.gdx.scenes.scene2d.ui.Label currentPlayerName
           
static com.badlogic.gdx.scenes.scene2d.ui.Label electricityQuant
           
static int expandedheight
           
static SpriteButton game_card_togglebtn
           
static Sprite game_menuobject_cornerframe
           
static SpriteButton game_menuobject_endturnbutton
           
static SpriteButton game_menuobject_goalscreenbtn
           
static SpriteButton game_menuobject_infobutton
           
static SpriteButton game_menuobject_menubtn
           
static Sprite game_menuobject_resourcesbar
           
static SpriteButton game_menuobject_shopbtn
           
static Sprite game_menuobject_ticketenclosure
           
static SpriteButton game_menuobject_tickettoggle
           
static Sprite game_menuobject_topbar
           
static SpriteButton game_menuobject_traindepotbtn
           
static SpriteButton game_resources_togglebtn
           
static com.badlogic.gdx.scenes.scene2d.ui.Label goldQuant
           
static int menuobjectsStageEnd
           
static int menuobjectsStageStart
           
static com.badlogic.gdx.scenes.scene2d.ui.Label nuclearQuant
           
static com.badlogic.gdx.scenes.scene2d.ui.Label oilQuant
           
static com.badlogic.gdx.scenes.scene2d.ui.Label playerScore
           
static boolean resourcebarexpanded
           
static int resourcesStageEnd
           
static int resourcesStageStart
           
 
Constructor Summary
GameScreenUI()
           
 
Method Summary
 void create(com.badlogic.gdx.scenes.scene2d.Stage stage)
          Create method instantiates all Labels, Sprites and SpriteButtons in the Main game screen and then adds them to the stage.
static com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle getLabelStyle(int fontsize)
           
static int getStageEnd()
          Get the resources stage end
static int getStageStart()
          get the stage start for the menu objects
static void refreshResources()
          refreshResources() refreshes all resource quantities for the current player.
static void setResourcesHeight(float height)
          Changes all quantity label heights with the toggle resources button
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

playerScore

public static com.badlogic.gdx.scenes.scene2d.ui.Label playerScore

game_menuobject_topbar

public static Sprite game_menuobject_topbar

game_menuobject_ticketenclosure

public static Sprite game_menuobject_ticketenclosure

game_menuobject_tickettoggle

public static SpriteButton game_menuobject_tickettoggle

game_menuobject_goalscreenbtn

public static SpriteButton game_menuobject_goalscreenbtn

game_menuobject_menubtn

public static SpriteButton game_menuobject_menubtn

currentPlayerName

public static com.badlogic.gdx.scenes.scene2d.ui.Label currentPlayerName

game_menuobject_cornerframe

public static Sprite game_menuobject_cornerframe

game_menuobject_infobutton

public static SpriteButton game_menuobject_infobutton

game_menuobject_shopbtn

public static SpriteButton game_menuobject_shopbtn

game_menuobject_traindepotbtn

public static SpriteButton game_menuobject_traindepotbtn

game_menuobject_endturnbutton

public static SpriteButton game_menuobject_endturnbutton

menuobjectsStageStart

public static int menuobjectsStageStart

menuobjectsStageEnd

public static int menuobjectsStageEnd

goldQuant

public static com.badlogic.gdx.scenes.scene2d.ui.Label goldQuant

coalQuant

public static com.badlogic.gdx.scenes.scene2d.ui.Label coalQuant

oilQuant

public static com.badlogic.gdx.scenes.scene2d.ui.Label oilQuant

electricityQuant

public static com.badlogic.gdx.scenes.scene2d.ui.Label electricityQuant

nuclearQuant

public static com.badlogic.gdx.scenes.scene2d.ui.Label nuclearQuant

cardQuant

public static com.badlogic.gdx.scenes.scene2d.ui.Label cardQuant

game_menuobject_resourcesbar

public static Sprite game_menuobject_resourcesbar

game_card_togglebtn

public static SpriteButton game_card_togglebtn

game_resources_togglebtn

public static SpriteButton game_resources_togglebtn

resourcesStageStart

public static int resourcesStageStart

resourcesStageEnd

public static int resourcesStageEnd

expandedheight

public static int expandedheight

resourcebarexpanded

public static boolean resourcebarexpanded
Constructor Detail

GameScreenUI

public GameScreenUI()
Method Detail

create

public void create(com.badlogic.gdx.scenes.scene2d.Stage stage)
Create method instantiates all Labels, Sprites and SpriteButtons in the Main game screen and then adds them to the stage. Method follows simple formula throughout - Sprite: 1.Create new Sprite - requires x , y and texture 2.Add to actors array SpriteButtton: 1.Create new Sprite - requires x , y and texture 2.Add onClicked method -- an action for the sprite 3.Add to actors array Label: 1.Create new Label with LabelStyle style (If you need to change font size call style= getLabelStyle(fontsize) ) 2.Set Colour, Text , x and y 3.Add to actors array

Parameters:
stage - The stage is the central collection of actors(Sprites and SpriteButtons) passed from GameScreen

getStageStart

public static int getStageStart()
get the stage start for the menu objects

Returns:
Int stage start

getStageEnd

public static int getStageEnd()
Get the resources stage end

Returns:
Int stage end

refreshResources

public static void refreshResources()
refreshResources() refreshes all resource quantities for the current player.


setResourcesHeight

public static void setResourcesHeight(float height)
Changes all quantity label heights with the toggle resources button

Parameters:
height - the height that the labels are to be raised or lowered to

getLabelStyle

public static com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle getLabelStyle(int fontsize)
Parameters:
fontsize - -the size of the font style returned by method
Returns:
returns full LabelStyle with fontsize passed