Subversion Repositories AndroidProjects

Rev

Rev 598 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.gebauz.PonPonChun.gamestates;

import com.gebauz.Bauzoid.game.Game;
import com.gebauz.Bauzoid.gamestates.BaseGameState;
import com.gebauz.Bauzoid.graphics.sprite.Sprite;
import com.gebauz.PonPonChun.game.GameConsts;

public class AsyncTestState extends BaseGameState
{
       
        private Sprite mTest = null;

        public AsyncTestState(Game game)
        {
                super(game);
                setFading(true, true);
               
                mTest = new Sprite(getGraphics(), "data/textures/landscape.png");
        }
       
        @Override
        public void initAsync(String param)
        {
                mTest.initAsync();
        }

        @Override
        public void init(String param)
        {
                mTest.init();
                mTest.pivotX = 0;
                mTest.pivotY = 0;
                mTest.x = 0;
                mTest.y = 0;
                mTest.w = GameConsts.VIRTUAL_SCREEN_WIDTH;
                mTest.h = GameConsts.VIRTUAL_SCREEN_HEIGHT;
        }

        @Override
        public void exit()
        {
                if (mTest != null)
                {
                        mTest.dispose();
                        mTest = null;
                }
        }

        @Override
        public void update(float deltaTime)
        {
        }

        @Override
        public void render()
        {
                getGraphics().clear(0.35f, 0.25f, 0.35f, 0.0f);
               
                getRenderStates().projection.setOrtho(
                                0.0f,
                                GameConsts.VIRTUAL_SCREEN_WIDTH-1,
                                GameConsts.VIRTUAL_SCREEN_HEIGHT-1,
                                0.0f,
                                0.0f,
                                1.0f
                        );
               
                mTest.x = 0;
                mTest.y = 0;
                mTest.render();
        }
}