Package transientlibs.preui.objects.states

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

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

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.logging.Level;
import java.util.logging.Logger;
import transientlibs.bindedobjects.core.GDXImageCatalog;
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.InfoGroup;
import transientlibs.preui.objects.gui.elements.Marker;
import transientlibs.preui.objects.gui.interfaces.IImage;
import transientlibs.processors.misc.ClickProcessor;

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

    public final int upCoord = 500;
    public final int leftCoord = 400;
    //ButtonGroup actionButtons;
    InfoGroup infoWindow;
    InfoGroup infoWindow2;
    Marker titleMarker;

    public TransientCreditsState(int setStateID, String setID) {
        super(setStateID, setID);



        //infoFont = Detonator.INSTANCE.fontProvider.Droid_Sans_16_No_Outline;
        textFont = Detonator.INSTANCE.fontProvider.getDefaultFont();

        actionButtons = new ButtonGroup(100, 100, textFont, this);

        //setDefaultButtonImages(SlickImageCatalog.Button1_Black, SlickImageCatalog.Button1_Gray);



    }

    @Override
    public void init() {
        super.init();
       
        //Log.info("WAAAAAAAT: ");

        IImage team = Detonator.INSTANCE.imageProvider.getImage("team_logo");

        titleMarker = new Marker(team, 1, 1);
        passMarkerNoHover(titleMarker);
        titleMarker.centerImage();

actionButtons = addGroup(400, 600);
        actionButtons.addOption("Website").addPayload(new CallWebsite());
        actionButtons.addStateOption("Back", TransientGame.MainMenuStateID);
        actionButtons.complete();

        int namesX = GDXImageCatalog.getCenteredX(team);
        int namesY = GDXImageCatalog.getCenteredY(team);
       
        namesX = 160;
        namesY = 450;
       
        int titlesX = 600;
        int titlesY = namesY;


        infoWindow = addInfoGroup(namesX, namesY);

        Log.info("Name coords: " + infoWindow.screenCoords.toRoundedString());

        infoWindow.addOption("caryoscelus");
        infoWindow.addOption("kibertoad");
        infoWindow.addOption("Tleno");
        infoWindow.addOption("Alagremm");
        infoWindow.addOption("pencil");
        infoWindow.addOption("lonely2012");               
        infoWindow.addOption("spirulence");       
        infoWindow.addOption("The Avatar of Woe");                                       

        //infoWindow.addOption("Tleno");                               
        //infoWindow.addOption("Cheshir");

        infoWindow2 = addInfoGroup(titlesX, titlesY);

        infoWindow2.addOption("Illustrious Master of Arts");
        infoWindow2.addOption("Duct Tape Architect");
        infoWindow2.addOption("Legendarish Pixelmeister");
        infoWindow2.addOption("Underground Gunsmith");
        infoWindow2.addOption("Iconoclastic Designer");
        infoWindow2.addOption("Apocalypse Draftsman");               
        infoWindow2.addOption("Magister of Euphonious Machines");               
        infoWindow2.addOption("Preemptively Cool Watchmaker");
       
        //infoWindow2.addOption("Embellishment Expeditor");

        /*
         InfoGroup x = new InfoGroup ((SlickImageCatalog.getCenteredX(lastButtonImage) +200), SlickImageCatalog.getImageByCode("team").getHeight(), infoFont, this);
         x.buttonYOffset = x.buttonYOffset + 2;

         x.addOption("Thanks to Steven Askew for the awesome logo http://redandblackwallpapers.com");

         passMarker (x);
         */
    }



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

        playMusic("credits");
    }
   
    public class CallWebsite implements ClickProcessor {

        @Override
        public void process() {
                    java.net.URI foo = null;

            try {
                foo = new java.net.URI("http://www.harmonicarobot.com");


            } catch (URISyntaxException ex) {
                Logger.getLogger(TransientCreditsState.class.getName()).log(Level.SEVERE, null, ex);
            }

            java.awt.Desktop desktop = java.awt.Desktop.getDesktop();

            //if (desktop.isSupported(java.awt.Desktop.Browse(foo))) {


            try {
                desktop.browse(foo);
            } catch (IOException ex) {
                Logger.getLogger(TransientCreditsState.class.getName()).log(Level.SEVERE, null, ex);
            }
            //}

        }
        }
       
   
   
}
TOP

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

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.