CannonShooter/core/src/de/samdev/cannonshooter/Textures.java

36 lines
1.3 KiB
Java

package de.samdev.cannonshooter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import de.samdev.absgdx.framework.menu.texdef.AgdxTextureDefinitionLoader;
import de.samdev.absgdx.framework.util.exceptions.AgdtexdefLoadException;
import de.samdev.absgdx.framework.util.exceptions.AgdtexdefParsingException;
public final class Textures {
public static AgdxTextureDefinitionLoader spritesheet;
//#########################################################################
public static TextureRegion level_background;
public static TextureRegion cannon_body;
public static TextureRegion[] cannon_barrel;
public static TextureRegion[] cannon_hearth;
public static TextureRegion cannon_bullet;
public static void init() throws AgdtexdefParsingException, AgdtexdefLoadException {
spritesheet = new AgdxTextureDefinitionLoader(Gdx.files.internal("spritesheet.agdtexdef"), new Texture("spritesheet.png"));
spritesheet.parse();
level_background = spritesheet.getSingleTexture("level_background");
cannon_body = spritesheet.getSingleTexture("cannon_body");
cannon_barrel = spritesheet.getTextureArray("cannon_barrel");
cannon_hearth = spritesheet.getTextureArray("cannon_hearth");
cannon_bullet = spritesheet.getSingleTexture("cannon_bullet");
}
}