HUD for StandardLevel

This commit is contained in:
Mike Schwörer 2015-09-25 15:30:50 +02:00
parent bf46dfd1b6
commit 26badd541b
4 changed files with 109 additions and 1 deletions

View File

@ -12,4 +12,76 @@
<flatten_array identifier="cannon_barrel" >
<array_2d coordinates_offset="2048,0" identifier="tex_chess_figures" width="512" height="256" size_x="4" size_y="8" />
</flatten_array>
</texturedefinitions>
<group coordinates_offset="1742,2424">
<texture identifier="img_speed_0" coordinates="1333,0 343,304" />
<texture identifier="img_speed_1" coordinates=" 304,0 343,304" />
<texture identifier="img_speed_2" coordinates=" 647,0 343,304" />
<texture identifier="img_speed_3" coordinates=" 990,0 343,304" />
<texture identifier="img_close" coordinates=" 0,0 343,304" />
</group>
<!-- ########################################### -->
<gui>
<textureprovider identifier="guiprovider_hud">
<MenuButton>
<group coordinates_offset="2046, 2304">
<texture identifier="pad-topleft" coordinates="00,00 32,32" />
<texture identifier="pad-top" coordinates="59,00 01,32" />
<texture identifier="pad-topright" coordinates="87,00 32,32" />
<texture identifier="pad-right" coordinates="87,59 32,01" />
<texture identifier="pad-bottomright" coordinates="87,87 32,32" />
<texture identifier="pad-bottom" coordinates="59,87 01,32" />
<texture identifier="pad-bottomleft" coordinates="00,87 32,32" />
<texture identifier="pad-left" coordinates="00,59 32,01" />
<texture identifier="pad-northleft" coordinates="32,00 26,32" />
<texture identifier="pad-northright" coordinates="61,00 26,32" />
<texture identifier="pad-easttop" coordinates="87,32 32,26" />
<texture identifier="pad-eastbottom" coordinates="87,61 32,26" />
<texture identifier="pad-southleft" coordinates="32,87 26,32" />
<texture identifier="pad-southright" coordinates="61,87 26,32" />
<texture identifier="pad-westtop" coordinates="00,32 32,26" />
<texture identifier="pad-westbottom" coordinates="00,61 32,26" />
</group>
<state appendix="NORMAL" coordinates_offset="2171, 2309">
<texture identifier="topleft" coordinates="0,0 1,1" />
<texture identifier="top" coordinates="2,0 1,1" />
<texture identifier="topright" coordinates="4,0 1,1" />
<texture identifier="right" coordinates="4,2 1,1" />
<texture identifier="bottomright" coordinates="4,4 1,1" />
<texture identifier="bottom" coordinates="2,4 1,1" />
<texture identifier="bottomleft" coordinates="0,4 1,1" />
<texture identifier="left" coordinates="0,2 1,1" />
<texture identifier="center" coordinates="2,2 1,1" />
</state>
<state appendix="HOVERED" coordinates_offset="2171, 2309">
<texture identifier="topleft" coordinates="0,0 1,1" />
<texture identifier="top" coordinates="2,0 1,1" />
<texture identifier="topright" coordinates="4,0 1,1" />
<texture identifier="right" coordinates="4,2 1,1" />
<texture identifier="bottomright" coordinates="4,4 1,1" />
<texture identifier="bottom" coordinates="2,4 1,1" />
<texture identifier="bottomleft" coordinates="0,4 1,1" />
<texture identifier="left" coordinates="0,2 1,1" />
<texture identifier="center" coordinates="2,2 1,1" />
</state>
<state appendix="PRESSED" coordinates_offset="2188, 2309">
<texture identifier="topleft" coordinates="0,0 1,1" />
<texture identifier="top" coordinates="2,0 1,1" />
<texture identifier="topright" coordinates="4,0 1,1" />
<texture identifier="right" coordinates="4,2 1,1" />
<texture identifier="bottomright" coordinates="4,4 1,1" />
<texture identifier="bottom" coordinates="2,4 1,1" />
<texture identifier="bottomleft" coordinates="0,4 1,1" />
<texture identifier="left" coordinates="0,2 1,1" />
<texture identifier="center" coordinates="2,2 1,1" />
</state>
</MenuButton>
</textureprovider>
</gui>
</texturedefinitions>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<frame textures="guiprovider_hud">
<grid iscontainer="true">
<grid.columndefinitions>
<columndefinition width="10"/>
<columndefinition width="60"/>
<columndefinition width="10"/>
<columndefinition width="60"/>
<columndefinition width="10"/>
<columndefinition width="60"/>
<columndefinition width="10"/>
<columndefinition width="60"/>
<columndefinition width="1*"/>
</grid.columndefinitions>
<grid.rowdefinitions>
<rowdefinition height="10"/>
<rowdefinition height="53"/>
<columndefinition width="1*"/>
</grid.rowdefinitions>
<button grid.row="1" grid.column="1" image="img_speed_0" />
<button grid.row="1" grid.column="3" image="img_speed_1" />
<button grid.row="1" grid.column="5" image="img_speed_2" />
<button grid.row="1" grid.column="7" image="img_speed_3" />
</grid>
</frame>

View File

@ -3,6 +3,8 @@ package de.samdev.cannonshooter.level;
import java.util.ArrayList;
import java.util.List;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.math.Vector2;
import de.samdev.absgdx.framework.AgdxGame;
@ -10,6 +12,7 @@ import de.samdev.absgdx.framework.layer.GameLayer;
import de.samdev.absgdx.framework.map.TileMap;
import de.samdev.absgdx.framework.map.background.RepeatingBackground;
import de.samdev.absgdx.framework.map.mapscaleresolver.ShowCompleteMapScaleResolver;
import de.samdev.absgdx.framework.util.exceptions.AgdxmlParsingException;
import de.samdev.cannonshooter.Textures;
import de.samdev.cannonshooter.entities.Cannon;
import de.samdev.cannonshooter.teams.Team;
@ -32,6 +35,12 @@ public class StandardLevel extends GameLayer {
initMap();
try {
setHUDFromAgdxml(Gdx.files.internal("standard_hud.agdxml"), Textures.spritesheet, new BitmapFont(Gdx.files.internal("consolefont.fnt")));
} catch (AgdxmlParsingException e) {
throw new RuntimeException(e);
}
//setTimeMultiplier(3);
}

Binary file not shown.