Tag Info

New answers tagged


If your chunks are square, you could align Tiles into a single array, and use a little math to find you indices. For example: class Chunk { final int SIZE = 8; int[] tiles = new int[SIZE * SIZE]; int getTile(int col, int row) { return tiles[row * SIZE + col; } } The same this could be applied to Map. I'm not sure how much more efficient this ...


I use and extended OrthographicCamera to fix this. package ferret.util; import com.badlogic.gdx.graphics.OrthographicCamera; /** * OrthographicCamera that cannot go beyond specified rectangle. */ public class BoundedCamera extends OrthographicCamera { private float xmin; private float xmax; private float ymin; private float ymax; ...


Doh!! First question was a dumb one - objects are included in the XML output and parsed correctly by libgdx - this only works of course if you save the .tmx file to the right location. I was of course using the wrong file!!!


I had similar problem with zoomed in rendering. I assume by "Box2D" render you mean Box2D debug renderer. Well, here is your problem. Before rendering debug data of Box2D, transform camera accordingly (add 0.5 or whatever, as you said) and after rendering Box2D debug stuff do the inverse transformation (subtract 0.5). I hope I understood your problem and my ...

Top 50 recent answers are included