DEADSOFTWARE

Add inventory bar
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / Assets.java
1 package ru.deadsoftware.cavecraft;
3 import com.badlogic.gdx.Gdx;
4 import com.badlogic.gdx.graphics.Texture;
5 import com.badlogic.gdx.graphics.g2d.Sprite;
6 import com.badlogic.gdx.graphics.g2d.TextureRegion;
8 public class Assets {
10 public static final int BLOCK_TEXTURES = 3;
12 public static Texture charTexture;
13 public static Sprite[] playerSprite = new Sprite[2];
15 public static Sprite shade;
17 public static Texture terrain;
18 public static TextureRegion[] blockTextures = new TextureRegion[BLOCK_TEXTURES];
20 public static Texture gui;
21 public static TextureRegion invBar;
22 public static TextureRegion invCur;
24 public static void load() {
25 charTexture = new Texture(Gdx.files.internal("char.png"));
26 playerSprite[0] = new Sprite(new TextureRegion(charTexture, 0,0,8,30));
27 playerSprite[0].flip(false,true);
28 playerSprite[1] = new Sprite(new TextureRegion(charTexture, 8,0,8,30));
29 playerSprite[1].flip(false,true);
31 shade = new Sprite(new Texture(Gdx.files.internal("shade.png")));
33 gui = new Texture(Gdx.files.internal("gui.png"));
34 invBar = new TextureRegion(gui,0,0,182,22);
35 invCur = new TextureRegion(gui,0,22,24,24);
37 terrain = new Texture(Gdx.files.internal("terrain.png"));
38 for (int i=0; i<BLOCK_TEXTURES; i++) {
39 blockTextures[i] = new TextureRegion(terrain,
40 (i%16)*16, (i/16)*16, 16,16);
41 blockTextures[i].flip(false,true);
42 }
43 }
45 }