A game library which enables cross-platform game development in Java, with support for Android development and desktop development. It makes use of OpenGL for portability.

learn more… | top users | synonyms

0
votes
0answers
7 views

SelectBox in LibGDX doesn't display and freezes the program after a click

I am currently trying to apply an overlay with LibGDX over my 3D ModelBatch. Everything works fine except for the SelectBox. Once instanciated, it shows up on my screen I can click on it once but then ...
0
votes
0answers
6 views

Incorrect click event when resize on libGdx

I want to use scene2D, in libGDX, to detect click on object. I have this simple Game sample : Stage stage; @Override public void create() { this.stage = new Stage(1280, 720, true); ...
-1
votes
0answers
26 views

How to add a nice looking muzzle flash to the tip of my guns

I am making a top down shooter and would like to add a muzzle flash to the tips of my guns. So I have an idea of what I want to do which would be just a circle that would fade from yellow to white or ...
0
votes
0answers
34 views

How to make good looking bullets with a trail for top-down shooter?

So I am making a TD shooter and was wondering how to make fancy bullets. Right now I have a giant sprite of a bullet trail that is the bullet as well but it doesn't look that good. I am using libgdx ...
0
votes
1answer
47 views

Is there any reasons to make sprites and bodies line up?

So in LibGDX the Sprite objects position is where it's 0,0 mark is in the word. In Box2D a a bodies position is in it's center. So to line these up when you update the sprites position with the ...
0
votes
0answers
12 views

GWT problem with Box2D WheelJoint

I am using the below libgdx java code for a wheel joint and rear axle using Box2D. This works fine for android, Desktop, but when I attempt to run through GWT I get the following error. at ...
0
votes
2answers
63 views

Publish android game only for 800 x 480 resolution in portrait mode

I have developed a game in libgdx. I worked for long and after finishing I found that the game runs perfectly on devices with resolution 800 x 480. I found this solution ...
3
votes
1answer
54 views

LibGDX How to take screenshot and use as background for pause screen

So I am trying to take a screenshot of the current situation during the PlayState of the game and when the player pauses the game I want the game to take a "screenshot" save it in memory and not as a ...
0
votes
0answers
28 views

Full resolution, with atlas, how to do with texturepack?

I'm trying to make the resolution of my game be like this example of Flappy Bird. if you download it to give notice that the zoom on the image it does not lose quality. But when I take my art in ...
0
votes
1answer
28 views

Libgdx stage rendering issues

I'm using scene2d for the first time, and I can't get anything to draw EXCEPT the stage ui. Say I have my ui on top of my game screen: uiStage.act(): batch.begin(); gameSprite.draw(batch); //does not ...
0
votes
0answers
28 views

Swing and LwjglAWTCanvas

I use LwjglAWTCanvas in my jFrame. I want to load textures on some swing event(I did it from postRunnable in order to get OpenGL contex). final LwjglAWTCanvas hexagonEditorCanvas = new ...
1
vote
0answers
22 views

Resize the Texture Region (parallax background) to fit my screen size in libgdx

I am using libgdx to make a running game. I am using vertical parallax background. I have successfully implemented parallax background many times. But for this game, I want my Texture region to fit my ...
2
votes
1answer
44 views

How do I split a texture into differently shaped pieces with libgdx?

I want to split a texture into variously shaped pieces with libgdx, like the pieces of a puzzle game. TextureRegion.split() is not an option, as it splits into equally sized rectangular texture ...
2
votes
1answer
25 views

How do I dynamically set a WheelJoint's anchor points?

I've created a car in RUBE and imported it into my game. The game has a tuning menu, allowing the ride height of the car to be adjusted with a slider. I can't work out how to change the position of ...
2
votes
2answers
44 views

How do I render a rounded rectangle in libgdx?

I've been thinking of ways to render a rounded rectangle in libgdx. I haven't found a pre-built way in the documentation. I've looked at: ShapeRenderer, but that's apparently quite expensive ...
0
votes
0answers
13 views

How to deal with different origins (y-coordinates) in libGDX?

I have a background image drawn to the screen with 0,0 coordinates in the bottom-left corner, as usual. Then I also have a (transparent) Pixmap in the same size as the background image, drawn on top ...
0
votes
2answers
95 views

Best practice for handling “dead” objects and their particles

I'm developing a side-scrolling run'n'gun game (but with planes! :P). I'm an experienced coder, but new to game development. When an enemy plane collides with a friendly missile, I start an explosion ...
2
votes
1answer
37 views

libgdx game not disposing

My game does not exit entirely even after calling dispose() method. It loads a black screen when I launch it for the second time and works well if I kill the game manually and restart it. I get an ...
0
votes
1answer
35 views

Libgdx. Converting Screen Click Coordinates into World Coordinates for 2D Game

I'm using the InputHandler's touchdown method. It gives me my screenX and screenY. Is there a simple way to convert screenX and screenY to world coordinates? By my understanding, InputHandler returns ...
0
votes
1answer
37 views

How to keep track of previous scenes and return to them in libgdx

I have three scenes: SceneTitle, SceneMenu, SceneLoad. (The difference between the title scene and the menu scene is that the title scene is what you see when you first turn on the game, and the menu ...
1
vote
1answer
34 views

Aspect ratio in LibGdx

I'm learning LibGdx and I need some help with the camera. Let's see, I'm making a Chu Chu Rocket! clon to start. I've loaded a TiledMap (10x10), and I've created an OrthographicCamera to show the ...
0
votes
1answer
23 views

LibGDX: Miscalculated polygon collision

These 2 polygons are not colliding, though this method returns true: Intersector.overlapConvexPolygons( new float[]{ 100.0f, 750.0f, ...
0
votes
0answers
29 views

Slowdown in sliding background with Libgdx

I´m new with libgx and i have a basic question. I want an background like an image that repeats indefinetely, and moves down. I did with 2 images and it worked, but the problem is that is very slow. I ...
0
votes
1answer
51 views

What is the approach of creating an image puzzle game with libgdx

I would like to create a game which consists of taking a random image, slicing it up into some number of pieces (according to a selected difficulty) and letting the player solve the puzzle. I've ...
0
votes
0answers
21 views

How to use the zoom gesture in libgdx?

I found the example code for the GestureListener class, but I don't understand the zoom method: private float initialScale = 1; public boolean zoom (float originalDistance, float currentDistance) { ...
1
vote
1answer
50 views

How to poll input for a gui in libgdx?

Ok, so my question is simple. How do you poll input with a GUI class without it affecting what's underneath the GUI? So suppose you have an RPG game with a gui for the d-pad and other controls: ...
0
votes
1answer
50 views

libgdx: Rotate sprite on 3d plane

Im trying to create a game on a 3d plane but with 2d objects. I have a perspective camera and the ground plane drawn. I can't seem to get sprites onto it. I am trying to render the sprites, then to ...
3
votes
0answers
48 views

How to make a smooth circuit path in Universal tween engine?

I tried to make a circuit by starting at point A, with waypoints B and C and final target at A again, and infinite repeats. What happens is that the path from A to B, B to C is smoothed, but path C to ...
4
votes
1answer
145 views

Why doesn't my android application rotate when I rotate my screen

I am building a game in LibGDX and the game screen orientation is in landscape. I want it to stay in landscape but I still want the user to be able to flip the device onto the other side and the ...
0
votes
3answers
48 views

Exception in thread “LWJGL Application”

I'm using libGDX for my android game in which I'm trying to use bitmap fonts. I have created .fnt and .png bitmap files using Bitmap font generator of angel code.Both .fnt and .png have been placed ...
0
votes
0answers
20 views

LibGDX gwt not finding Box2dLight [on hold]

I am trying to run a simple game on gwt but it is not compiling/working. The game uses Box2DLights, and is working for desktop and android, but unfortunately not for html/gwt. When I try to run gwt, ...
0
votes
1answer
59 views

How to clear out a drawn texture from the screen in libGDX

I am trying to clear out the drawn texture from the screen. Lets take a classic game example - in many games when the character goes through the coins the coins clears out from the screen and ...
0
votes
0answers
24 views

Missing character when using SpriteBatch and BitmapFont [closed]

I am new to Android and currently studying Libgdx demo game Very-Angry-Robots. However all text display in the game has missing characters. And the display of some numbers in the score bar is ...
-1
votes
0answers
52 views

Body height width is different from sprite height width in box2d libgdx

I have a problem with box2d in libgdx. I was makin 5 kinematic moving platform on which a dynamic body player can jump. Height of plateform is varying from 20 to 110 pixel which I am passing to body ...
0
votes
0answers
53 views

LibGDX vs Flash/Starling

I currently use Flash/Starling to develop cross platorm games. I love it because it has awesome features like tweens, texture atlases, DragonBones, touch gestures, ad integration, in app purchase ...
0
votes
1answer
32 views

libGDX without android dependancies

I want to create a game that due to some assumptions doesn't make sense as a tablet game. I already created some frame (controllers, autowiring, build scripts, etc.) that would help me later on, but ...
0
votes
0answers
23 views

Box2dLights rendering in bigger scale

So basically my box2dLights are rendering in wreid places. The circle in center is my player and as you can see lamp which should be aligned to player is in the right-top corner. my code: package ...
0
votes
1answer
74 views

LibGDX cannot save to internal file

I want to save the state of the game in a file, so I can read it at the next start. The Problem is, that I get a exception, if I try to save something internal. If I try to save it local all work ...
0
votes
1answer
48 views

How to get width and height from a body in box2d?

I am working on a game in Libgdx framework. I have to get width and height from a body in box2d. is their any way to get width an d height from a body in box2d??
0
votes
1answer
30 views

How can I get the object layers from a .tmx file in libgdx?

I can load in my .tmx map fine using TmxMapLoader().load. My test map has three layers ("layer1," "layer2," and "layer3"). There are also two oject layers named "platforms" and "obstacles." I have ...
1
vote
0answers
67 views

shader program vs spritebatch

I try to draw mesh with my own shaderProgram private static String vertexShader = "attribute vec4 a_position; \n" + "attribute vec4 a_color;\n" + "attribute vec2 ...
-1
votes
0answers
38 views

infinite parallax libgdx

I need help with my Parallax Libgdx, he manages to make the scroll, but not getting any way to repeat it infinite. public void render() { ParallaxLayer layer2 = null; float a = 0; ...
0
votes
0answers
16 views

Artificial physics : ball angle bouncing (Vector2) [duplicate]

My question is : how can I manage to move my object (ball) on a trajectory , and onContact with another object, it bounces, respecting the angle
2
votes
2answers
102 views

How to draw a rectangle or curve between two co-ordinates in libGDX

I am new to libGDX.I just want a Rectangle or a small curve drawn between the object and the clicked position .I know libGDX has RECTANGLE class. I just want to draw a rectangle or a curved line to ...
1
vote
1answer
30 views

How to match user click and the sprite object position in libGDX framework

I am using libGDX Java framework for developing a practice game in Eclipse. My game is in landscape mode and I am using sprite image for game assets. Actually I am trying to follow the Kilobolt ...
1
vote
1answer
80 views

Movement and rotation of bodies in top down game

We are developing a 2D top down game with libgdx using the included box2d as physics engine. We don't want our bodies to accelerate but to instantly move with the wanted velocity. The bodies are ...
0
votes
0answers
25 views

White background on BitMapFont

I've tried placing a white "background" on a font that is being rendered with LibGDX, with no success. I'm using the font.draw to draw the loaded font on the screen, but every way that I tried, the ...
1
vote
1answer
50 views

how to make different sprite when moving and aiming [duplicate]

I want to create top down game where you are Russian soldier in libGDX. The player controls the soldier with W/A/S/D and aims with the mouse. That way the soldier can run sideways and shoot towards ...
1
vote
1answer
93 views

Best mobile games resolution ratio

What is the best landscape and portrait resolution ratios that will fit the most of the devices out there and the black bars size will be minimum?
0
votes
0answers
29 views

libgdx get rotated sprite coords points

I would like to get the position of each edge of a sprite when he has been rotated. I have no idea how to do it, I made a image to explain it. I would like to get the X and Y position of each Red ...