Android Open Source - Tetris-Evolution Resources






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.tools;
//from w  w w .j  ava  2 s .  c  om
import java.util.HashMap;
import java.util.Map;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class Resources {

  public static final Texture getTexture(String imageName){
    return new Texture(Gdx.files.internal("res/img/" + imageName));
  }
  
  public static final TextureRegion getTextureRegion(Texture texture, int x, int y, int width, int height){
    return new TextureRegion(texture, x, y, width, height);
  }
  
  public static final HashMap<Integer, TextureRegion> splitImage(String imageName, int width, int height){
    Texture texture = getTexture(imageName);
    
    HashMap<Integer, TextureRegion> splitTexture = new HashMap<Integer, TextureRegion>();
    
    for (int column = 0; column < (int) texture.getWidth() / 32; column++) {
      splitTexture.put(column, getTextureRegion(texture, column * 32, 0, 32, 32));
    }
    
    return splitTexture;
  }
}




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