Package transientlibs.preui.agents.rendering

Source Code of transientlibs.preui.agents.rendering.GDXGenericStateDrawAgent

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

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import transientlibs.slick2d.util.Log;
import transientlibs.processors.misc.ClickProcessor;
import transientlibs.preui.objects.gui.interfaces.IMarker;
import transientlibs.preui.objects.states.IState;

/**
*
* @author kibertoad
*/
public class GDXGenericStateDrawAgent implements ClickProcessor{
   
    public String fps;
    public IState state;
   
    public SpriteBatch spriteBatch;
   
    public BitmapFont systemFont = new BitmapFont();
   
   
    public GDXGenericStateDrawAgent (IState setState) {
        state = setState;
        spriteBatch = new SpriteBatch (100);
    }

    @Override
    public void process() {
       
        //Log.warn("Draw state: "+state.getStringID());
        //Log.warn("Markers in storage: "+state.getDrawStorage().size());
       
        spriteBatch.begin();
       
        for (IMarker m: state.getDrawStorage()) {
            //Log.info("DRAW STUFF: "+m.toString()+": "+m.getScreenCoords().toString());
            //spriteBatch.draw((TextureRegion)m.getImage(), m.getScreenCoords().x, m.getScreenCoords().y);
            if (m.isDrawn()) {
               
                //Log.warn("Draw marker");
               
            m.draw(spriteBatch);
            }
           
        }
       
        //systemFont.draw(spriteBatch, "Mouse: "+Gdx.input.getX()+"/"+Gdx.input.getY(), 850, 50);       
        //fps = Integer.toString((int)(1/Gdx.graphics.getDeltaTime()));
        //systemFont.draw(spriteBatch, "FPS: "+fps, 850, 100);
       
        spriteBatch.end();
       
        state.processInput();
       
    }

    public void centerCameraOnPlayer() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
   
}
TOP

Related Classes of transientlibs.preui.agents.rendering.GDXGenericStateDrawAgent

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.