Package transientlibs.preui.objects.states

Source Code of transientlibs.preui.objects.states.TransientMainMenuState

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package transientlibs.preui.objects.states;


import transientlibs.slick2d.util.Log;

import transientlibs.processors.misc.Detonator;
import transientlibs.preui.objects.gui.elements.ButtonGroup;
import transientlibs.preui.objects.gui.interfaces.IMarker;
import transientlibs.preui.objects.gui.elements.TextMarker;
import transientlibs.preui.objects.gui.misc.ButtonEffect;
import transientlibs.preui.utils.layout.HorizontalAlign;
import transientlibs.preui.utils.layout.VerticalAlign;

/**
*
* @author kibertoad
*/
public class TransientMainMenuState extends TransientState {

    public IMarker titleImage = null;

//    public TransientMainMenuState (int setStateID) {
//        superthis (setStateID);
//    }
    public TransientMainMenuState(int setStateID, String setID) {
        super(setStateID, setID);

        textFont = Detonator.INSTANCE.fontProvider.getDefaultFont();

        titleImage = Detonator.INSTANCE.interfaceElements.get("titleimage");


    }

    //infoFont = Detonator.INSTANCE.fontProvider.Droid_Sans_16_No_Outline;
    @Override
    public void init() {

        super.init();

        if (titleImage != null) {
            //passMarkerNoHover(titleImage);
        } else {
            Log.info("No title image");
        }


        actionButtons = (ButtonGroup) Detonator.INSTANCE.interfaceElements.get("mainmenubuttons");
        //actionButtons.hoveredButtonImage = Detonator.INSTANCE.
       
        if (actionButtons != null) {
            elementManager.passGroup(actionButtons);


            actionButtons.highlightedColour = Detonator.INSTANCE.colourFactory.defaultHoveredButtonColour;
            //actionButtons.ButtonYOffset = 20;
            actionButtons.textHAlign = HorizontalAlign.left;
            actionButtons.textVAlign = VerticalAlign.top;


            actionButtons.addOption("New game");
            //TextMarker.lastTextMarker.acts.addStateTransition(Detonator.INSTANCE.currentGenericGame.getNewGameStateID());
            TextMarker.lastTextMarker.addPayload(new ButtonEffect (Detonator.INSTANCE.currentGenericGame.getNewGameStateID()));

            //uncomment later
            //actionButtons.addStateOption ("About team", Detonator.INSTANCE.currentGame.CreditsStateID);



            actionButtons.addOption("Quit");
            //uncomment later
            TextMarker.lastTextMarker.addPayload(new ButtonEffect (TransientGame.QuitStateID));


            actionButtons.complete();
        }
    }

    @Override
    public void enter() {
        super.enter();

        Detonator.INSTANCE.musicPlayer.playMusic("mainmenu");
    }
}
TOP

Related Classes of transientlibs.preui.objects.states.TransientMainMenuState

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.