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
;
10 public static final int BLOCK_TEXTURES
= 3;
12 public static Texture charTexture
;
13 public static TextureRegion
[] playerSkin
= new TextureRegion
[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 Texture touchGui
;
25 public static TextureRegion
[] touchArrows
= new TextureRegion
[4];
26 public static TextureRegion touchLMB
, touchRMB
;
27 public static TextureRegion touchToggleMode
;
28 public static TextureRegion touchSpace
;
30 public static void load() {
31 charTexture
= new Texture(Gdx
.files
.internal("char.png"));
32 playerSkin
[0] = new TextureRegion(charTexture
, 0,0,8,30);
33 playerSkin
[0].flip(false,true);
34 playerSkin
[1] = new TextureRegion(charTexture
, 8,0,8,30);
35 playerSkin
[1].flip(false,true);
37 shade
= new Sprite(new Texture(Gdx
.files
.internal("shade.png")));
39 gui
= new Texture(Gdx
.files
.internal("gui.png"));
40 invBar
= new TextureRegion(gui
,0,0,182,22);
41 invCur
= new TextureRegion(gui
,0,22,24,24);
43 touchGui
= new Texture(Gdx
.files
.internal("touch_gui.png"));
44 for (int i
=0; i
<4; i
++) {
45 touchArrows
[i
] = new TextureRegion(touchGui
, i
*26, 0, 26,26);
46 touchArrows
[i
].flip(false, true);
48 touchLMB
= new TextureRegion(touchGui
, 0, 26, 26,26);
49 touchLMB
.flip(false, true);
50 touchRMB
= new TextureRegion(touchGui
, 52, 26, 26,26);
51 touchRMB
.flip(false, true);
52 touchToggleMode
= new TextureRegion(touchGui
, 26, 26, 26, 26);
53 touchToggleMode
.flip(false, true);
54 touchSpace
= new TextureRegion(touchGui
, 0, 52, 104, 26);
55 touchSpace
.flip(false, true);
57 terrain
= new Texture(Gdx
.files
.internal("terrain.png"));
58 for (int i
=0; i
<BLOCK_TEXTURES
; i
++) {
59 blockTextures
[i
] = new TextureRegion(terrain
,
60 (i
%16)*16, (i
/16)*16, 16,16);
61 blockTextures
[i
].flip(false,true);