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
1answer
44 views

my movement is working good on keyboard but on android its not

So basically here is what my movement is like for keys: key down if (keycode == Keys.LEFT) { mishi.getAcceleration().x = -13; } key up if (keycode == Keys.LEFT) { ...
0
votes
0answers
16 views

Using libgdx to display different textures above and below generated terrain

I'm working on a Scorched Earth clone using libgdx. So far I've been able to dynamically generate the terrain as seen in the screenshot below: The polygons below the terrain surface are currently ...
0
votes
1answer
52 views

Most efficient way of brighten and darken sprites with OpenGL > 2.0

So I have been shading (brighten/darken +adding color) my sprites by using glTexEnvf with GL_MODULATE and GL_ADD and a vertex color. I only had to rebind the batch every time I needed to change from ...
0
votes
0answers
13 views

How to correctly set window size in Libgdx scene2d.ui dialog

In my libGDX application I am using the scene2d.ui classes to render my game's GUI. One of the things I render via these classes is a dialog window with a background image set. I have created the ...
0
votes
0answers
34 views

Libgdx vs Cocos2d-x [on hold]

What is your preferred game engine for developing mobile games today? I pick this two since it is one of the popular among open source game engine. I been reading its documentation and view all the ...
0
votes
0answers
27 views

Why is my text is too large even when scaled to .05f in libGDX?

I'm trying to scale down my fonts as my game objects are also small. I'd like to scale them down the same way as my sprites. However, if I scale them below .05, the font disappears! My attempt at ...
0
votes
1answer
39 views

Two issues with testing LibGDX on Android

1) When I test my game on desktop it is 100% fine. When I test it on my Nexus 7 physical device, it is the same except the backgrounds have no color. For example my splash screen has a greenish ...
0
votes
0answers
28 views

Collision in Tiled Map - LibGDX

I have collision code that deals with left or right or top or bottom. I am using Tiled Map with LibGDX. Question is: How do I detect collision with other cells by all 4 sides, and not specifically ...
5
votes
2answers
123 views

Creating Platform game with Inclined Levels

Till now I have developed platform games in which a player can only move and detect tiles linearly. I wonder on how to implement games in which a player can move on an inclined or irregular surface. ...
0
votes
0answers
53 views

Simple Libgdx bullet example

I'm looking for a SIMPLE example of the use of the bullet physics engine in libgdx. Before you point me at the wiki, I have read that, but that mostly describes installation, and just a "raw" ...
0
votes
1answer
44 views

How do I combine two textures / texture regions / images into a single entity using libgdx?

I've googled this but can't seem to find anything on "concatenating" two images, especially using libgdx. Any ideas? (pointers, algorithm suggestions, etc are highly appreciated) Thanks.
0
votes
0answers
14 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
21 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); ...
0
votes
1answer
95 views

How to add a nice looking muzzle flash to the tip of my guns [on hold]

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
53 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
54 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
18 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
86 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
65 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
36 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
32 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
30 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
39 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
53 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
26 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
69 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
16 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
103 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
48 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
41 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
45 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
25 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
35 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
56 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
22 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
52 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
59 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
52 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
148 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
53 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
1answer
65 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 ...
-1
votes
0answers
62 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
68 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
45 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
28 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
78 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
58 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
38 views

How can I get the object layers from a .tmx file in libgdx? [on hold]

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
75 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 ...