Android Open Source - Tetris-Evolution Splash






From Project

Back to project page Tetris-Evolution.

License

The source code is released under:

GNU General Public License

If you think the Android project Tetris-Evolution listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.mygdx.states;
/*from   w  w  w  .  j a v a 2s  .  c o m*/
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.mygdx.tools.GifDecoder;

public class Splash implements Screen {
  
  private final static int width = Gdx.graphics.getWidth();
  private final static int height = Gdx.graphics.getHeight();

  private TextureRegion textureCurrentFrame;
  
  private final SpriteBatch batch = new SpriteBatch();;
  private final Animation animation = GifDecoder.loadGIFAnimation(Animation.PlayMode.NORMAL, Gdx.files.internal("res/img/splash.gif").read());;
  
  private float deltaAccumulator = 0.0f;
  
  @Override
  public void render(float delta) {
    Gdx.gl.glClearColor(0, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    
        if (animation.isAnimationFinished(deltaAccumulator)){
          ((Game) Gdx.app.getApplicationListener()).setScreen(new MainMenu());
          
        } else {
        deltaAccumulator += delta;
        textureCurrentFrame = animation.getKeyFrame(deltaAccumulator, true); 
        }
    
        batch.begin();
        batch.draw(textureCurrentFrame, 0, 0, width, height);
        batch.end();
        
  }

  @Override
  public void resize(int width, int height) {

    
  }

  @Override
  public void show() {

  }

  @Override
  public void hide() {
    
  }

  @Override
  public void pause() {
    
  }

  @Override
  public void resume() {
    
  }

  @Override
  public void dispose() {
    
  }

}




Java Source Code List

com.mygdx.TetrisEvolution.android.AndroidLauncher.java
com.mygdx.TetrisEvolution.client.HtmlLauncher.java
com.mygdx.TetrisEvolution.desktop.DesktopLauncher.java
com.mygdx.blocks.Block.java
com.mygdx.blocks.BlocksBox.java
com.mygdx.blocks.Connect.java
com.mygdx.blocks.Level.java
com.mygdx.blocks.LogicScheme.java
com.mygdx.game.Game.java
com.mygdx.main.TetrisEvolution.java
com.mygdx.modes.DarwinMode.java
com.mygdx.modes.Mode.java
com.mygdx.renderer.ModeRenderer.java
com.mygdx.states.Info.java
com.mygdx.states.MainMenu.java
com.mygdx.states.ModeMenu.java
com.mygdx.states.Play.java
com.mygdx.states.Splash.java
com.mygdx.tools.GifDecoder.java
com.mygdx.tools.InvertXY.java
com.mygdx.tools.Resources.java
com.mygdx.util.Collision.java