parent
4bef651d49
commit
d6c92dc6e6
@ -0,0 +1,2 @@
|
||||
Inn
|
||||
#-1
|
||||
@ -0,0 +1,2 @@
|
||||
Hier kann man später schlafen
|
||||
...#-1
|
||||
@ -0,0 +1,2 @@
|
||||
Hier kann man später schlafen
|
||||
...#-1
|
||||
@ -0,0 +1,3 @@
|
||||
Ich bin der Besitzer dieses Inns! Möchtest du hier schlafen?
|
||||
Ja, gerne!#-1
|
||||
Nein, gerade nicht.#-1
|
||||
@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="20" height="10" tilewidth="32" tileheight="32" infinite="0" nextlayerid="13" nextobjectid="33">
|
||||
<tileset firstgid="1" source="../tilesets/village.tsx"/>
|
||||
<tileset firstgid="1801" source="../tilesets/worldborder.tsx"/>
|
||||
<tileset firstgid="1821" source="../tilesets/furniture.tsx"/>
|
||||
<tileset firstgid="3229" source="../tilesets/container.tsx"/>
|
||||
<layer id="3" name="under0" width="20" height="10">
|
||||
<data encoding="csv">
|
||||
983,983,983,983,983,983,983,983,983,983,983,0,0,983,983,983,983,983,983,983,
|
||||
983,983,983,983,983,983,983,983,983,983,983,0,983,983,983,983,983,983,983,983,
|
||||
983,983,983,983,983,983,983,983,983,983,983,0,983,983,983,983,983,983,983,983,
|
||||
983,983,983,983,983,983,983,983,983,983,983,0,983,983,983,983,983,983,983,983,
|
||||
983,983,983,983,983,983,983,983,983,983,983,0,983,983,2827,2827,2827,2827,983,983,
|
||||
983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,
|
||||
983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,
|
||||
983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,
|
||||
983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,
|
||||
983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="4" name="under1" width="20" height="10">
|
||||
<data encoding="csv">
|
||||
2824,2824,2824,2824,2824,2824,2824,2824,2824,2824,2824,0,2824,2824,2824,2827,2827,2824,2824,2824,
|
||||
2856,2856,2856,2856,2856,2856,2856,2856,2856,2856,2856,0,2856,2856,2856,2827,2827,2856,2856,2856,
|
||||
0,0,0,0,0,0,0,0,0,0,0,2827,0,0,0,2827,2827,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2827,2827,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1806,1808,1807,1806,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,2825,2824,2824,2888,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,2857,2856,2856,2920,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="5" name="under2" width="20" height="10">
|
||||
<data encoding="csv">
|
||||
0,0,0,0,0,0,0,3788,0,0,2827,2827,2454,2455,2456,1820,1819,2454,2455,2456,
|
||||
0,0,0,0,0,1904,0,3804,0,0,2827,2827,2486,2487,2488,1802,1805,2486,2487,2488,
|
||||
0,0,0,0,0,1901,0,0,0,0,2827,0,2518,2519,2520,1802,1805,2518,2519,2520,
|
||||
0,0,0,0,0,1901,0,0,0,0,2827,2827,0,0,0,1802,1805,0,0,0,
|
||||
0,0,0,0,0,1901,2362,0,0,0,2827,2827,0,0,1814,0,0,1813,0,0,
|
||||
0,0,0,0,0,1933,1838,1841,1999,1840,2825,2888,0,0,0,2677,2678,2679,0,0,
|
||||
0,0,0,0,0,1872,1874,1873,0,1874,2857,2920,0,0,0,2709,2710,2711,0,0,
|
||||
2637,2638,2639,0,0,0,0,0,0,0,0,0,0,0,0,2741,2742,2743,0,0,
|
||||
2072,2072,2073,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
2640,2641,2642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="6" name="above0" width="20" height="10">
|
||||
<data encoding="csv">
|
||||
0,0,0,0,0,0,0,0,0,0,1820,1819,1806,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,1802,1805,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,1802,1805,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,1802,1805,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,1810,1809,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1816,1806,2513,1815,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="7" name="above1" width="20" height="10">
|
||||
<data encoding="csv">
|
||||
1814,1806,1806,1806,1806,1806,1806,1806,1806,1806,0,0,0,1806,1806,0,0,1806,1806,1813,
|
||||
1802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
|
||||
1802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
|
||||
1818,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1806,0,0,1805,
|
||||
1820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
|
||||
1802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
|
||||
1802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
|
||||
1810,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1809
|
||||
</data>
|
||||
</layer>
|
||||
<objectgroup id="8" name="CollisionRects">
|
||||
<object id="1" x="0" y="0" width="640" height="51"/>
|
||||
<object id="5" x="320" y="50" width="320.5" height="47"/>
|
||||
<object id="6" x="480" y="96" width="64" height="32"/>
|
||||
<object id="7" x="453.667" y="128" width="118.333" height="81.5"/>
|
||||
<object id="8" x="487" y="208.5" width="80.5" height="44"/>
|
||||
<object id="10" x="319" y="97" width="63.5" height="114"/>
|
||||
<object id="12" x="165.5" y="51" width="24.5" height="121.5"/>
|
||||
<object id="13" x="192" y="128" width="32" height="32"/>
|
||||
<object id="15" x="228" y="35.5" width="24.5" height="25"/>
|
||||
<object id="16" x="0" y="224" width="96" height="96"/>
|
||||
<object id="17" x="-1" y="191.5" width="8.5" height="31"/>
|
||||
<object id="18" x="0" y="50" width="8" height="78"/>
|
||||
<object id="19" x="95.3333" y="312.667" width="544.667" height="7.33333"/>
|
||||
<object id="20" x="633.333" y="97.3333" width="6.66667" height="215.333"/>
|
||||
<object id="22" x="165.333" y="172.667" width="88.6667" height="43"/>
|
||||
<object id="23" x="253.667" y="172.333" width="34.3333" height="19"/>
|
||||
<object id="24" x="287.667" y="171.667" width="31" height="40.3333"/>
|
||||
</objectgroup>
|
||||
<objectgroup id="9" name="DoorRects">
|
||||
<object id="26" x="0" y="127.667" width="3.33333" height="64.3333">
|
||||
<properties>
|
||||
<property name="destinationDoor" type="int" value="1"/>
|
||||
<property name="destinationMap" type="int" value="2"/>
|
||||
<property name="exit" type="int" value="3"/>
|
||||
<property name="id" type="int" value="0"/>
|
||||
</properties>
|
||||
</object>
|
||||
</objectgroup>
|
||||
<objectgroup id="10" name="InteractionRects">
|
||||
<object id="30" x="394" y="8.5" width="76" height="87.5">
|
||||
<properties>
|
||||
<property name="id" type="int" value="1"/>
|
||||
<property name="texture" value="-"/>
|
||||
</properties>
|
||||
</object>
|
||||
<object id="31" x="553.5" y="7.5" width="77" height="89">
|
||||
<properties>
|
||||
<property name="id" type="int" value="2"/>
|
||||
<property name="texture" value="-"/>
|
||||
</properties>
|
||||
</object>
|
||||
</objectgroup>
|
||||
<objectgroup id="11" name="NpcRects">
|
||||
<object id="32" x="207" y="90.5" width="21.5" height="20.5">
|
||||
<properties>
|
||||
<property name="id" type="int" value="0"/>
|
||||
<property name="texture" value="sprite.png"/>
|
||||
</properties>
|
||||
</object>
|
||||
</objectgroup>
|
||||
<objectgroup id="12" name="EnemyRects"/>
|
||||
</map>
|
||||
|
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 1003 B After Width: | Height: | Size: 1.5 KiB |
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tileset version="1.4" tiledversion="1.4.3" name="worldborder" tilewidth="32" tileheight="32" tilecount="8" columns="4">
|
||||
<image source="../pngs/worldBorder.png" width="128" height="64"/>
|
||||
<tileset version="1.4" tiledversion="1.4.3" name="worldborder" tilewidth="32" tileheight="32" tilecount="16" columns="4">
|
||||
<image source="../pngs/worldBorder.png" width="128" height="128"/>
|
||||
</tileset>
|
||||
|
||||
@ -0,0 +1,91 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.trs.main.view.UI;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.GL20;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||
import com.badlogic.gdx.graphics.g2d.GlyphLayout;
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
|
||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
||||
import com.trs.main.Main;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author janeh
|
||||
*/
|
||||
public class DebugUI {
|
||||
|
||||
private BitmapFont font;
|
||||
private ShapeRenderer shapeRenderer = new ShapeRenderer();
|
||||
Batch batch = new SpriteBatch();
|
||||
|
||||
public DebugUI() {
|
||||
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("fontData/font.ttf"));
|
||||
FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
|
||||
parameter.size = 21;
|
||||
font = generator.generateFont(parameter);
|
||||
generator.dispose();
|
||||
font.setColor(Color.BLACK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void draw(int entityAmount){
|
||||
float textHeight = getTextHeight(font, "A")+5;
|
||||
|
||||
ArrayList<String> strings = new ArrayList<>();
|
||||
strings.add("DeltaTime: "+Gdx.graphics.getDeltaTime());
|
||||
strings.add("FPS: "+(int)(1/Gdx.graphics.getDeltaTime()));
|
||||
strings.add("Actors: "+entityAmount);
|
||||
|
||||
float width = 0;
|
||||
for(String s : strings){
|
||||
float textWidth = getTextWidth(font, s);
|
||||
if(textWidth > width){
|
||||
width = textWidth;
|
||||
}
|
||||
}
|
||||
|
||||
Gdx.gl.glEnable(GL20.GL_BLEND);
|
||||
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
|
||||
shapeRenderer.begin(ShapeRenderer.ShapeType.Filled);
|
||||
shapeRenderer.setColor(0.1f, 0.1f, 0.1f, 0.8f);
|
||||
shapeRenderer.rect(5, Gdx.graphics.getHeight() - (strings.size()+1)*textHeight-5, width+10,(strings.size()+1)*textHeight);
|
||||
shapeRenderer.end();
|
||||
Gdx.gl.glDisable(GL20.GL_BLEND);
|
||||
|
||||
|
||||
batch.begin();
|
||||
// DRAW FRAMETIME
|
||||
font.setColor(Color.RED);
|
||||
|
||||
for(int i = 1; i < strings.size()+1; i++){
|
||||
font.draw(batch, strings.get(i-1), 10,Gdx.graphics.getHeight()-textHeight*i);
|
||||
}
|
||||
|
||||
|
||||
batch.end();
|
||||
|
||||
|
||||
|
||||
}
|
||||
public float getTextWidth(BitmapFont font, String text){
|
||||
GlyphLayout glyphLayout = new GlyphLayout();
|
||||
glyphLayout.setText(font,text);
|
||||
return glyphLayout.width;
|
||||
}
|
||||
public float getTextHeight(BitmapFont font,String text){
|
||||
GlyphLayout glyphLayout = new GlyphLayout();
|
||||
glyphLayout.setText(font,text);
|
||||
return glyphLayout.height;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue