6a99f1d3a60a34fab05ad670b5caf81418193115
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
.Animation
;
6 import com
.badlogic
.gdx
.graphics
.g2d
.BitmapFont
;
7 import com
.badlogic
.gdx
.graphics
.g2d
.Sprite
;
8 import com
.badlogic
.gdx
.graphics
.g2d
.TextureRegion
;
12 public static final int BLOCK_TEXTURES
= 18;
14 public static BitmapFont minecraftFont
;
16 public static Texture charTexture
;
17 public static Sprite
[][] playerSkin
= new Sprite
[2][4];
19 public static Sprite shade
;
21 public static Texture terrain
;
22 public static TextureRegion
[] blockTextures
= new TextureRegion
[BLOCK_TEXTURES
];
24 public static Texture gui
;
25 public static TextureRegion invBar
;
26 public static TextureRegion invCur
;
28 public static Texture touchGui
;
29 public static TextureRegion
[] touchArrows
= new TextureRegion
[4];
30 public static TextureRegion touchLMB
, touchRMB
;
31 public static TextureRegion touchToggleMode
;
32 public static TextureRegion touchSpace
;
34 public static void load() {
35 minecraftFont
= new BitmapFont(Gdx
.files
.internal("font.fnt"), true);
36 charTexture
= new Texture(Gdx
.files
.internal("mobs/char.png"));
39 playerSkin
[0][0] = new Sprite(new TextureRegion(charTexture
, 0,0,12,12));
40 playerSkin
[0][0].flip(false,true);
42 playerSkin
[0][1] = new Sprite(new TextureRegion(charTexture
, 0,13,12,12));
43 playerSkin
[0][1].flip(false,true);
45 playerSkin
[0][2] = new Sprite(new TextureRegion(charTexture
, 25,5,20,20));
46 playerSkin
[0][2].flip(false,true);
48 playerSkin
[0][3] = new Sprite(new TextureRegion(charTexture
, 25,27,20,20));
49 playerSkin
[0][3].flip(false,true);
52 playerSkin
[1][0] = new Sprite(new TextureRegion(charTexture
, 13,0,12,12));
53 playerSkin
[1][0].flip(false,true);
55 playerSkin
[1][1] = new Sprite(new TextureRegion(charTexture
, 13,13,12,12));
56 playerSkin
[1][1].flip(false,true);
58 playerSkin
[1][2] = new Sprite(new TextureRegion(charTexture
, 37,5,20,20));
59 playerSkin
[1][2].flip(false,true);
61 playerSkin
[1][3] = new Sprite(new TextureRegion(charTexture
, 37,27,20,20));
62 playerSkin
[1][3].flip(false,true);
65 shade
= new Sprite(new Texture(Gdx
.files
.internal("shade.png")));
67 gui
= new Texture(Gdx
.files
.internal("gui.png"));
68 invBar
= new TextureRegion(gui
,0,0,182,22);
69 invCur
= new TextureRegion(gui
,0,22,24,24);
71 touchGui
= new Texture(Gdx
.files
.internal("touch_gui.png"));
72 for (int i
=0; i
<4; i
++) {
73 touchArrows
[i
] = new TextureRegion(touchGui
, i
*26, 0, 26,26);
74 touchArrows
[i
].flip(false, true);
76 touchLMB
= new TextureRegion(touchGui
, 0, 26, 26,26);
77 touchLMB
.flip(false, true);
78 touchRMB
= new TextureRegion(touchGui
, 52, 26, 26,26);
79 touchRMB
.flip(false, true);
80 touchToggleMode
= new TextureRegion(touchGui
, 26, 26, 26, 26);
81 touchToggleMode
.flip(false, true);
82 touchSpace
= new TextureRegion(touchGui
, 0, 52, 104, 26);
83 touchSpace
.flip(false, true);
85 terrain
= new Texture(Gdx
.files
.internal("terrain.png"));
86 for (int i
=0; i
<BLOCK_TEXTURES
; i
++) {
87 blockTextures
[i
] = new TextureRegion(terrain
,
88 (i
%16)*16, (i
/16)*16, 16,16);
89 blockTextures
[i
].flip(false,true);