Map coordinates to camera coordinates
I have a tiled map which is 3 times higher than camera. When I press on a tile, I want an actor on that tile to show up. This works if camera is not moved. If I move camera a little bit up, so the tile...
View ArticleLibGDX: Skin and scaling problems
I’m trying to use Skins with TextButtons. However I’m having an issue where the TextureRegions of the Skin are NOT being scaled down to the tablesize. This is leading to an issue like in this image: As...
View ArticleLibGDX Deployment questions
A few questions from LibGDX newbie: How do you deploy a Mac/Windows app? If Mac app, can this be deployed to Mac App Store? Do you need to pay monthly (for RoboVM) for iOS development/deployment? I am...
View Articlelibgdx html part in browser only shows libgdx logo
I am trying to run HTML part of libgdx. I followed its official guide https://github.com/libgdx/libgdx/wiki/Project-setup,-running-&-debugging I have installed GWT plugin, I did GWT compile and...
View ArticleClickListener getTapCount() returns 0
I want to detect the double tap on a Container. If it is detected, then i have to remove the Actor associated with it. This is my first attempt: addListener(new ClickListener() { if(getTapCount() == 2)...
View Article2D – Smooth lighting with shadows for a tile-based game
for the last week or so I have been completely stuck on trying to implement efficient lighting. I’ve been researching and experimenting and I’ve looked everywhere that I have been capable of finding,...
View ArticleFollowPath steering behavior
I’m having a problem with AI movement in my top-down game. AI builds path and than moves using libgdx FollowPath (this problem is still actual) steering behavior. I have some solutions, but can’t guess...
View ArticleLibGDX – Map Boundaries
Synopsis Well, I’m making a little top-down JRPG and today I was like ‘Yeah, I’m gonna bust out this whole map collision thing!’. I failed. Problem So I went on the internet and looked up ‘LibGDX Tiled...
View ArticleHow do I set an object's speed to arrive in X seconds?
I want to move an object to a point in the game world, I have the distance value which is far the player should move. I want to complete the movement in X seconds. I have tried many equations and...
View ArticlelibGDX Error loading font file – Netbeans
I’m trying to load a font in libGDX. But I can’t figure out want I do wrong. Code: white = new BitmapFont(Gdx.files.internal("fonts/white.font"), false); Error: Exception in thread "LWJGL Application"...
View ArticleHow to fix overly blurred texture / image in unity?
so, I’m not sure what caused this, let image below do the explanation : How to fix the overly blurred texture in unity? It’s so frustrating, since I can’t get it right, because when I tried it in...
View ArticleHow to draw a polygon with picture in libgdx?
I’m working around a simple rectangle game, It just split the rectangle in to a lot of polygon debris. I use Pixmap and Texture to draw the edges of each polygon. ... for (GraphEdge e: _edges) {...
View ArticleLibGDX – Rotating sprites and still keep the positioning between them
I’ve been struggling with a problem regarding rotations and relative positions between sprites (in this case, the sprites are just lines) – a bit off-topic, but should i be using the ShapeRenderer...
View ArticleMinimum number of moves algorithm in Java
I’m looking to implement the minimum number of moves algorithm for the java game I’m developing but I can’t quite figure it out. Here’s an example picture: There are also some specifications about...
View ArticleSlingshot gravity effect
I am trying to make a sling-shot that fires a projectile. I want it to act like the standard sling-shot in angry birds. So far I managed to get the “pulling” effect, ie. If I draw backwards it fires in...
View Articleset sprite to current animation texture
In my game I have some box2d bodies where I add sprites using the following code in my render() method. for (Body body : worldBodies) { if (body.getUserData() instanceof Sprite) { Sprite sprite =...
View ArticleLibGdx – APP42 Cloud API Java SDK – weird crash at insertJSONDocument
I’m using App42 Cloud API for saving user data. I created app in App42 console, added the keys in my code. But when I try to upload the data to the cloud, the app crashes. try { appStorage =...
View ArticleGetting screen coordinates of actor
I’m trying to tell if an actor exists at a screen position so I can do something if the actor is clicked on. To do this, I first need to get the screen coordinates of the actor so I can compare it to...
View ArticleJava and Steam JVM deployment
I am currently considering my options for game development and deploying to Steam Greenlight. I really like Java with libGDX, especially for its cross platform Android potential, and I understand that...
View ArticlelibGDX render 2 tiled maps at different coordinates
I am currently learning libGDX and I want to make a game that loads multiple tiled maps and renders them. This is what I have now: public class PlayScreen implements Screen{ private Main game; private...
View Article