DEADSOFTWARE

Add creative inventory
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / Assets.java
index 96dbbdc328e46d8c69ddcdd70493b25fd7440389..e1fd5c94a1c44923c39ad4fb0ff97462453ad1d4 100644 (file)
@@ -2,15 +2,19 @@ package ru.deadsoftware.cavecraft;
 
 import com.badlogic.gdx.Gdx;
 import com.badlogic.gdx.graphics.Texture;
+import com.badlogic.gdx.graphics.g2d.Animation;
+import com.badlogic.gdx.graphics.g2d.BitmapFont;
 import com.badlogic.gdx.graphics.g2d.Sprite;
 import com.badlogic.gdx.graphics.g2d.TextureRegion;
 
 public class Assets {
 
-    public static final int BLOCK_TEXTURES = 3;
+    public static final int BLOCK_TEXTURES = 18;
+
+    public static BitmapFont minecraftFont;
 
     public static Texture charTexture;
-    public static TextureRegion[] playerSkin = new TextureRegion[2];
+    public static Sprite[][] playerSkin = new Sprite[2][4];
 
     public static Sprite shade;
 
@@ -21,6 +25,10 @@ public class Assets {
     public static TextureRegion invBar;
     public static TextureRegion invCur;
 
+    public static Texture creativeTexture;
+    public static TextureRegion creativeInv;
+    public static TextureRegion creativeScroll;
+
     public static Texture touchGui;
     public static TextureRegion[] touchArrows = new TextureRegion[4];
     public static TextureRegion touchLMB, touchRMB;
@@ -28,11 +36,35 @@ public class Assets {
     public static TextureRegion touchSpace;
 
     public static void load() {
-        charTexture = new Texture(Gdx.files.internal("char.png"));
-        playerSkin[0] = new TextureRegion(charTexture, 0,0,8,30);
-        playerSkin[0].flip(false,true);
-        playerSkin[1] = new TextureRegion(charTexture, 8,0,8,30);
-        playerSkin[1].flip(false,true);
+        minecraftFont = new BitmapFont(Gdx.files.internal("font.fnt"), true);
+        charTexture = new Texture(Gdx.files.internal("mobs/char.png"));
+        //LOOK TO LEFT
+        //head
+        playerSkin[0][0] = new Sprite(new TextureRegion(charTexture, 0,0,12,12));
+        playerSkin[0][0].flip(false,true);
+        //body
+        playerSkin[0][1] = new Sprite(new TextureRegion(charTexture, 0,13,12,12));
+        playerSkin[0][1].flip(false,true);
+        //hand
+        playerSkin[0][2] = new Sprite(new TextureRegion(charTexture, 25,5,20,20));
+        playerSkin[0][2].flip(false,true);
+        //leg
+        playerSkin[0][3] = new Sprite(new TextureRegion(charTexture, 25,27,20,20));
+        playerSkin[0][3].flip(false,true);
+        //LOOK TO RIGHT
+        //head
+        playerSkin[1][0] = new Sprite(new TextureRegion(charTexture, 13,0,12,12));
+        playerSkin[1][0].flip(false,true);
+        //body
+        playerSkin[1][1] = new Sprite(new TextureRegion(charTexture, 13,13,12,12));
+        playerSkin[1][1].flip(false,true);
+        //hand
+        playerSkin[1][2] = new Sprite(new TextureRegion(charTexture, 37,5,20,20));
+        playerSkin[1][2].flip(false,true);
+        //leg
+        playerSkin[1][3] = new Sprite(new TextureRegion(charTexture, 37,27,20,20));
+        playerSkin[1][3].flip(false,true);
+
 
         shade = new Sprite(new Texture(Gdx.files.internal("shade.png")));
 
@@ -40,6 +72,12 @@ public class Assets {
         invBar = new TextureRegion(gui,0,0,182,22);
         invCur = new TextureRegion(gui,0,22,24,24);
 
+        creativeTexture = new Texture(Gdx.files.internal("allitems.png"));
+        creativeInv = new TextureRegion(creativeTexture, 0, 0, 176, 208);
+        creativeInv.flip(false,true);
+        creativeScroll = new TextureRegion(creativeTexture, 2, 209, 12, 15);
+        creativeScroll.flip(false, true);
+
         touchGui = new Texture(Gdx.files.internal("touch_gui.png"));
         for (int i=0; i<4; i++) {
             touchArrows[i] = new TextureRegion(touchGui, i*26, 0, 26,26);