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

1
vote
0answers
31 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
26 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
257 views

How to update libgdx scene2d Label text dynamically?

I display a BitmapFont on the screen, update its text and the font is updated dynamically on the screen as well. I seem to fail to do the same with a scene2d Label added as actor to a Stage. The ...
0
votes
1answer
16 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
8 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
11 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
33 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
45 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 ...
1
vote
0answers
142 views

How do I implement a “sliding out of / into” effect on a settings menu similar to that in Angry Birds?

I'm trying to implement a settings menu component similar to that in Angry Birds - a button control that makes an options menu slide out of it and back into it when clicked on. I use scene2d.ui to ...
0
votes
2answers
344 views

Problem with AssetManager while loading a Model type

Today I've tried the AssetManager for the first time with .g3db files and I'm having some problems. Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: ...
0
votes
1answer
48 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
2answers
68 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 ...
0
votes
0answers
14 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 ...
2
votes
1answer
566 views

Problem Implementing Texture on Libgdx Mesh of Randomized Terrain

I'm having problems understanding how to apply a texture to a non-rectangular object. The following code creates textures such as this: from the debug renderer I think I've got the physical shape ...
0
votes
2answers
655 views

LibGDX Perspective Camera for 2D

I'm very new to LibGDX and I'm trying to use DecalBatch with PerspectiveCamera, simply to have z-coordinate for my sprites, as SpriteBatch does not offer that. However, I don't know how to calculate ...
3
votes
1answer
59 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
1answer
343 views

libgdx actors and instant actions

I'm having trouble with actors and actions. I have a list of actors, they all have either no action, or 1 sequence action This sequence action has either : a couple of actions (some are instant, ...
0
votes
0answers
30 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 ...
2
votes
1answer
38 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
29 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 ...
3
votes
2answers
82 views

Blending semi-transparent images while not stacking their alphas

In libgdx/OpenGL ES I want to render multiple semitransparent textures while keeping the alpha still semi transparent. For example If I render a 0.5 alpha circle on top of another 0.5 alpha circle, ...
0
votes
2answers
96 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 ...
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 ...
2
votes
1answer
46 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
132 views

How to have the game world get rendered on just a part of the screen?

I am implementing a game on both Desktop and Android. The Desktop version will just rely on the keyboard to handle the user input on the game screen, whilst the Android one will have to have a set ...
1
vote
0answers
26 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
2answers
47 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 ...
1
vote
2answers
1k views

rotating menu with Actors in libgdx

I am intending to build a circular menu, with menu items equally distributed around the circle. When clicking on a menu item the circle should rotate so that the selected item is facing the top. I am ...
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 ...
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
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 ...
1
vote
0answers
52 views

How can I transform a group of objects in libGDX?

I'm new in LibGDX. I created group with actors in show method and add listener (where i calculate rotation matrix) and want to rotate all actors from group with ...
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
1answer
94 views

libgdx ActorGestureListener.pan() parameters not moving actor in smooth line

I override the pan method in ActorGestureListener to implement dragging actors in libgdx (scene2d). When I move individual pieces on a board they move smoothly, but when moving the whole board, the ...
0
votes
1answer
37 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 ...
2
votes
0answers
164 views

How to create heat haze effect in Libgdx?

I would like to create a heat haze effect for a 2D game I am making. Do You have ideas or suggestions, how to get that effect. I am using Libgdx(OpenGL 2.0). Thank You in advance!
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
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
2answers
176 views

libgdx - collision detection with tiled map java

currently, I am working on a 2d rpg game which is similar to final fantasy 1-4. I can load up a tiled map and the sprite can walk freely on the map. However, I will like to create a wall for it to ...
4
votes
1answer
146 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
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, ...
1
vote
1answer
298 views

Handling XBox 360 Controller Connections in LibGDX after Game has Started

I am currently making a game with the java library LibGDX and want to add XBox 360 controller support using the GDX-Controllers extension. At the moment I have a setup where I create a listener to ...
1
vote
1answer
436 views

Libgdx import bin/xml/json from physics editor

I'm using Libgdx. I did a simple json file in Physics Body Editor and I don't have any idea how could I import it into my physic world in libgdx. Any idea will be appreciated. P.S: Sorry if there ...
0
votes
1answer
52 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 ...
1
vote
2answers
35 views

(LibGDX) Changing Origin of Box2D World relative to TiledMap (or Vice Versa)

I'm playing around with Box2D and TiledMaps and I've come across this minor annoyance. As you can see, both Box2D and TiledMap render at the center of the screen. This forces me to compensate by ...
0
votes
0answers
31 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 ...
1
vote
1answer
3k views

LibGDX Box2D Body and Sprite AND DebugRenderer out of sync

I am having a couple issues with Box2D bodies. I have a GameObject holding a Sprite and Body. I use a ShapeRenderer to draw an outline of the Body's and Sprite's bounding boxes. I also added a ...
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: ...
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 ...