LibGDX is a cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux, Mac OS X, Android, iOS and your WebGL enabled browser.

learn more… | top users | synonyms

1
vote
1answer
22 views

Convert MathAtan2 angle to degrees

I use an angle to set the velocity (or direction if you prefer) of my sprite, however, I want the sprite to be heading in the same angle as I'm moving, rotating according to that angle. How I set ...
1
vote
1answer
134 views

Dynamic Events in an Entity Component System

My game makes extensive use of libGDX's Entity Component System Ashley, and my game world (including all levels and areas) is created with Tiled. In Tiled, I have an object layer where all of my ...
2
votes
1answer
164 views

How do I check for collision between an ellipse and a rectangle?

I am working on LibGdx framework for developing a 2D isometric tower defense game.All my sprites are drawn in 2D isometric view. I have used an array list to store 8 points at boundary in the ...
1
vote
0answers
32 views

Physics Body editor loader collision detect

In my game I use the Physics Body Editor to add custom shapes to my bodies. In my show() method I use the follownig code to create my Jetski Body: BodyDef jetskiDef = new BodyDef(); ...
0
votes
1answer
59 views

libgdx FollowPath proper usage

I'm developing top-down rpg game and got some problems using https://libgdx.badlogicgames.com/gdx-ai/docs/com/badlogic/gdx/ai/steer/behaviors/FollowPath.html I have a path (picture 1), in this case 2 ...
0
votes
2answers
84 views

Slingshot 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 ...
1
vote
1answer
28 views

set 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) { ...
0
votes
1answer
67 views

Certain Unicode Characters not displaying when setting text to TextButton in libgdx

Ok I am trying to do a word game much like Hangman Pro but for a different language(specifically amharic) using libgdx . And I have got a list of words saved to text file and I have taken care of BOM ...
5
votes
1answer
216 views

AI pathfinding in mostly-free space

I'm working in an action/strategy proyect. Consider it a RTS game. The game is in 2D (with LibGDX), and I have a lot of soldiers moving along. Now I have to implement the AI. Let me say some things ...
0
votes
0answers
87 views

libgdx drawn a projectile trajectory cannot render

I am looking to draw a projectile trajectory . I found a lot of code such as : http://blog.gemserk.com/2012/07/03/drawing-a-projectile-trajectory-like-angry-birds-using-libgdx/ The code I editor; if ...
1
vote
3answers
30 views

undo touchdown in LibGDX with scene2D

i'm making a game in libgdx and i have a question. I have a Button from scene2d. If there is a touchDown event on this button, i want the touchUp event only inside my button. Now if i touchDown a ...
1
vote
1answer
54 views

My Sprite is disappearing when it collides with my floor (libGDX)

I am just starting to build the game "engine" and I am using a sprite drawn in the same position as a rectangle and the two always move together. I have another rectangle which is the floor when the ...
1
vote
1answer
47 views

Centering an animation [libGDX]

I have the following class: public class AnimationDemo implements ApplicationListener { private SpriteBatch batch; private TextureAtlas textureAtlas; private Animation animation; ...
0
votes
1answer
33 views

libGDX : Paint And Remove Color From Actor with touchDragged

I created two-dimensional array of Button actor, then I added new ClickListener() { touchDragged } as the following code: buttons = new Button[3][3]; for (int row = 0; row < buttons.length; ...
0
votes
2answers
99 views

How to close an app correctly on desktop?

When I use Gdx.app.exit() the game window closes but the resources don't appear to be released and the app is still running. For instance, to exit on when the escape key is pressed: public boolean ...
1
vote
1answer
60 views

LibGDX Headless System.in

I started developing a little multiplayer game with LibGDX and Kryonet. I'm also using the headless backend for the server. So far everything went well, but now I'd like to create a command-line ...
0
votes
1answer
67 views

Handling multiple input mapped to single in-game controls

I am trying to map multiple input types to single in-game controls using libGDX's InputProcessor and ControllerListener interfaces. Currently, I have created a single InputType interface which is ...
1
vote
1answer
101 views

Libgdx are textures off screen rendered?

Let's say that my code looks like this: OrtographicCamera camera=new OrthographicCamera(); camera.setToOrtho(true, 100, 150); SpriteBatch spriteBatch=new SpriteBatch(); ...
0
votes
0answers
32 views

How to detect number of pointers being used on screen?

I wan't to be able to detect if the screen is touched by two fingers at the same time. final int MAX_NUMBER_OF_POINTERS = 20; int pointers = 0; for(int i = 0; i < MAX_NUMBER_OF_POINTERS; ...
0
votes
1answer
41 views

libgdx automove Actor does not work

I am trying to make my sprite start moving from the moment it is created and do its animation. It draws on the screen right and animates but doesn't move. It should start moving towards the direction ...
1
vote
3answers
41 views

Libgdx RotateToAction does not directly rotate between 179 and -179

It took me a bit of debugging to realize why I'm having trouble with my rotations and it seems that rather than just moving the 2 degrees between 179 and -179, it prefers to rotate all the way in the ...
3
votes
1answer
53 views

Sensor listener setup/tear down android

I am developing my own game for android but when I open my app after 5 or 10 seconds it sets up the sensor listener and I can see a clear stuttering and the fps drops for a second to 40 fps instead of ...
1
vote
2answers
169 views

How 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 ...
1
vote
1answer
244 views

Soft Body Collision with Box2d (libGDX)

I've made a few classes to create soft body objects in libGDX using Box2D (specifically a circle and rectangle similar to these links). The objects are constructed of a number of circle shaped Box2D ...
1
vote
1answer
59 views

Change screen dimensions in libgdx in HTML

Can i change the screen dimensions in libGDX in HTML? If I inspect the element (the game) in Chrome and I change canvas width or height it changes the screen dimensions, but I don't know how to do it ...
1
vote
0answers
68 views

Libgdx - Transparent color over texture

I am attempting to tint a texture a color but I want the texture to show under the tint. For example, I have a picture of a person but I want to tint them a light green and not change the transparency ...
2
votes
1answer
72 views

Pixel thin lines appearing between sprites on camera move

I'm going to apologize in advance for the lack of screenshots, but this was a very hard thing to capture, but very obvious to see. I'm using LibGDX to create a tile base rogue-like. Everything is ...
2
votes
1answer
41 views

Call touchUp() programattically for sprite in LibGDX

I'm trying to call touchUp() for a sprite i've created in my app. i'm getting success but the co-ordinates do not match while i call it manually. final int x = (int)mySprite.getX() + 10; final int y ...
4
votes
1answer
131 views

Is there an optimal method to implement moving background?

I am trying to develop a little game using libGDX. We have a hero who jumps and world consist of dynamically created moving platforms in an auto side-scrolling manner. I wanted background to scroll at ...
1
vote
0answers
69 views

error after changing the app name

I have made a game in Libgdx(eclipse).I changed the name of the app inside the string.xml file.Now I have an error in AndroidManifest.xml. in this line: android:label="@string/app_name"‬ (line 12). ...
2
votes
1answer
209 views

How 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) { ...
1
vote
1answer
53 views

how to add “tween-engine-api” to my ilbgdx game

I finished now my first game at LibGDX (I am using Eclipse). I run the game in the desktop launcher and it works. I now want to run my game on android and IOS. From some guides I have read ,I ...
1
vote
0answers
55 views

resize images in libgdx

I know how to set Image width and height using pixel coords. Is there a way to set relative coords? I want to deal with multiple screens. For example i have 1920x1080 screen size. And i have relative ...
0
votes
1answer
15 views

libgdx: 2nd var of myClass()'s values saving to/overriding 1st var of myClass()

I'm using libgdx with Eclipse. PROBLEM: In the class inputHandler I have a list of buttons, menuButtons, composed of 2 buttons: playButton and retryButton. They both belong to the class ...
1
vote
1answer
46 views

3D mesh culling issue, further faces showing through closer faces

I'm trying to render a generated mesh using libGDX which acts as a java wrapper for openGL. The issue i'm having can be seen in the screenshot below. The faces of the mesh that should be hidden by ...
1
vote
1answer
184 views

Libgdx Networking (http requests) - Login [duplicate]

I am new to Networking and Databases, but im trying to learn MySQL and HTTP Requests to create a user Login for a game. My goal is to let users create accounts and login to them etc (for Highscores ...
-1
votes
1answer
44 views

precedurally generate blob-like surface? [closed]

Just looking for some direction, I'm making a 2d top-down game and need to make some random shapes for an asteroid surface. I want to have so control so I can have not too-circle-ish but not ...
1
vote
1answer
105 views

Tween animation with Universal Tween Engine LIbGDX

Let me preface by saying that I'm new to libgdx... I have an animation that I'm currently drawing to the screen using: game.batch.draw(flyAnimation2.getKeyFrame(elapsedTime, true), 200,200,0, 0, ...
1
vote
1answer
78 views

Screenshot always returning as a white image on iOS using robovm and libgdx

I am trying to take a screenshot for sharing on social media. This code works on my Desktop project, but when I use it on iOS it always shows up as a white image, I am using the standard libgdx code ...
0
votes
2answers
50 views

score displaying system without using bitmap [closed]

how to make a score displaying system without using bitmap in libgdx. I making a fluppy bird remake somone can explaim me in details?
0
votes
1answer
27 views

Box2d java contact point reference changes after collision

I am trying to hold the contacts made during a collision in an array list. After I add n amount of contacts, when I try to retrieve them later on, they point to the last contact made in the world. ...
1
vote
0answers
81 views

Rotating, moving and scaling a mask in a shader

I want to rotate, move or scale a mask in a shader. But I have no clue to how perform these actions. My code: @Override public void create() { batch = new SpriteBatch(); background = new ...
1
vote
1answer
153 views

LibGdx Sound start to give an error after loading GameScreen multiple times

I have a LibGdx game, where the user taps on the screen, and a Sound will play. When the user taps on the screen, a texture will "fire" another texture as a missile, and can hit a target, when this ...
0
votes
2answers
86 views

LibGDX: Content appears stretched although I'm using a ScreenViewport

I just fixed another issue regarding the scaling inside a ScreenViewport. And yet another problem arises: If I'm understanding the wiki correctly, a ScreenViewport does not scale or stretch the ...
0
votes
0answers
19 views

LibGdx - Sound stops working after a while with error from SoundPool/AudioTrack [duplicate]

I have a LibGdx game, where the user taps on the screen, and a Sound should play. After a while, the Sound stops, and all other Sounds too, but it doesn't stop completely, it plays after a while ...
0
votes
1answer
168 views

LibGDX: Issue with unitScale for Tiled and Box2D

I've got the following: I use a TiledMap (loaded from a .tmx), each tile 32x32 pixels in size and generate the Box2D bodies for collision from the TiledMap's ObjectLayer. That all works fine, no ...
1
vote
1answer
99 views

How can I implement child objects that follow the movement of a parent?

I'm looking for a way to have a character, let's call it "root," with a number of other similar characters attached to it. Let's call them children. When the root changes position the children follow ...
0
votes
1answer
51 views

The import aurelienribon cannot be resolved

I've been having problems with using the Tween Engine by aurelien ribon for a Splash Screen for my 2d game. I'm using Eclipse and libgdx. I've tried rebuilding, clean...-ing, and refreshing. I've ...
0
votes
2answers
90 views

Why does Intersector.overlaps return false?

I am trying my hand at creating a simple game using libGDX. The idea is: We have a hero who jumps and world consist of dynamically created moving platforms in an auto side-scrolling manner. In order ...
0
votes
1answer
28 views

Error when initializing Stage

I made a new class that implements Screen, what I've seen from other people's code is that they create a constructor that takes a parameter of Game game. I did not created a constructor, I think ...