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

3
votes
2answers
100 views

Why are my Box2D wheels slipping on ground?

I have a car, set up in Box2D as a rectangle connected with two wheels using WheelJoints: The wheels are defined as follows: FixtureDef wheelFixtureDef = new FixtureDef(); ...
0
votes
1answer
67 views

LibGDX drawing map using tiles without space

I am making a board game. To draw the map on the board I use different tiles. On some screen the map looks good but on some other screens there is a space between the tiles. How can I do so there ...
0
votes
1answer
28 views

LibGDX Z index for groups

Have three groups, A, B and C. Let B and C be children of A. Now set B.setZIndex(3) C.setZIndex(2) Why is C drawn over B, if B has a greater Z index? If you do this: C.setZIndex(2) ...
1
vote
1answer
96 views

How to make an Actor follow my finger

I'm back with another question that may be really simple. I've a texture drawn on my spritebatch and I'm making it move up or down (y-axis only) with Libgdx's Input Handler: touchDown and touchUp. ...
1
vote
0answers
41 views

LibGdx Triangle Collision

I'm back with another question. I'm trying to get a collision between an actor and a sprite. With the actor, which only moves upwards and downwards, I've got no problem since it's shape is a ...
0
votes
2answers
837 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 ...
1
vote
1answer
52 views

LibGDX Box2DLights shadow offset problem on bodies

Hello I just started to use LibGDX, and it's awesome. I looked at the Box2DLights library, and started to learn how the lighting work here. I got something up: As you can see, it works, but the ...
0
votes
1answer
521 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, ...
3
votes
1answer
500 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
53 views

If filled polygon cannot be drawn via libgdx ShapeRenderer , then what is the work around?

I know most of you would suggest me to draw a filled polygon by using combination of triangles and rectangles , but that is not possible for complex shapes . I want to basically draw a generic shape ...
0
votes
3answers
106 views

What is the easiest way to make an object follow the edge of a sprite?

I have a rounded rectangle sprite and another sprite that's just a circle. I want the center of the circle to follow the edge of the rounded rectangle. Is there any easy way to accomplish this task? ...
0
votes
1answer
99 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
2answers
93 views

LibGDX - draw bullet physics bounding box

I am very new to game development and I am trying to debug my 3d collision bounds. Could somebody give me an example on how to draw the collision bounds of an object in libGDX? I assume it has ...
1
vote
1answer
43 views

Cannot Efficiently Loop SequenceAction

Why doesn't this work and how do I fix it/create a different, working loop for this SequenceAction? public void setLoopingFade(float time) { fadeLoop = Actions.sequence(Actions.fadeOut(time), ...
0
votes
1answer
92 views

2d Ice movement

I am building an top-down 2d RPG like zelda. I have been trying to implement ice sliding. I have a tile with the slide property. I thought it would be easy to get working. I figured that I would ...
1
vote
3answers
678 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 ...
1
vote
1answer
198 views

How do I efficiently collide and match groups of coloured circles?

I am new to game programming and working on clone of this game in libgdx. The game has some static balls and one ball that moves. I want to check if the moving ball collides with any static ones, but ...
2
votes
1answer
145 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 ...
0
votes
1answer
32 views

Master sound volume in LibGDX

I have been searching everywhere for master volume for sound and music in LibGDX but to no avail. Can anyone tell me if it is implemented somewhere or do i need to implement such functionality myself? ...
0
votes
1answer
93 views

TiledMap not drawing completely

While attempting to constrain camera scrolling to within the TiledMap I discovered that it seems the renderer for the map is not drawing the entire map. The map is 1600x960px so one would assume the ...
1
vote
1answer
42 views

Daily Unlock in LibGDX

I am trying to make a game that is a collection of mini games. The mini games will unlock daily. There are story for each day. And the story cannot be repeated so for example the player start playing ...
0
votes
1answer
182 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
75 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 ...
0
votes
0answers
28 views

LibGdx how to get touched point in differente screen resolution

I'm developing a game actually on phone and tablet. In libgdx I found that using camera.unproject api with vector3 can get the relative coordinate for differente screen resolution however I doesn't ...
0
votes
2answers
79 views

libgdx - handling battery warning

I want to pause my game when the battery warning on Android pops up. How do I do this? I have a method that pauses the game but how do I call it when the battery warning pops up?
1
vote
1answer
55 views

Touchable Hud with Actors in Libgdx

I am writing a Tower Defense for Android. Right now my LevelScreen contains a Background-Actor which is pan-able and some zones to buy Towers - after buying them you can upgrade them further. When you ...
0
votes
1answer
72 views

Array of map data

I'm looking for your thoughts on the best way to store map data. I need to store data for territory ownership for each pixel on the map. The data for each pixel is as such: Player 1 points: 24 ...
1
vote
1answer
610 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
2answers
45 views

LibGDX Images not loading

Now my Image isn't loading to the screen. I tried to be decorative with the code but since it isn't working I made it just like the video I'm whatching. I don't get any exceptions, but the image ...
0
votes
0answers
33 views

Experiencing weird effects with framebuffer

So I am trying to build a working flashlight in my game. I am using libgdx and the framebuffer class but there are some weird effects that I am experiencing and that may be due to my lack of ...
0
votes
3answers
520 views

LibGDX Android version

I am trying to use the LibGDX UI Project creator to create LibGDX projects, but it doesn't allow me to choose the Andorid version for the project. This is a problem for some android features. For ...
1
vote
1answer
128 views

Matrix rotation wrong orientation LibGDX

I'm having a problem with matrix rotation in libgdx. I rotate it using the method matrix.rotate(Vector3 axis, float angle) but the rotation happens in the model orientation and I need it happens in ...
1
vote
1answer
4k 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 ...
2
votes
1answer
67 views

How can I use imprecise accelerometer data for controls?

I want to rotate an object with respect to the phone's position. I use the accelerometer output to detect orientation: float roll = Gdx.input.getRoll(); float pitch = Gdx.input.getPitch(); float ...
0
votes
1answer
96 views

How to follow object on CatmullRomSplines at constant speed (e.g. train and train carriage)?

I have a CatmullRomSpline, and using the very good example at https://github.com/libgdx/libgdx/wiki/Path-interface-%26-Splines I have my object moving at an even pace over the spline. Using a simple ...
0
votes
1answer
46 views

Does LibGDX abstract OpenGL ES away or can I still use my OpenGL ES knowledge?

I've been learning OpenGL ES, and am now turning my attention to using LibGDX. My main concern with LibGDX is, if needed, will I be able to apply my OpenGL ES knowledge to something if needed and ...
1
vote
1answer
95 views

Problem to match font size to the screen resolution in libgdx

I'm having problems to show text on my game at same size on different screens, and I did a simple test. This test consists to show a text fitting at the screen, I want the text has the same size ...
4
votes
1answer
797 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 ...
1
vote
1answer
74 views

Restarting a libGDX game to apply changes to resolution

How can I restart a LibGDX game to apply certain changes to the game such as changes to the resolution (going from 1920X1080 to 1280X720), or changing full screen. Granted the resize(int width, int ...
1
vote
0answers
22 views

LibGDX mesh silhouettes

How could I find out the silhouette edges of a mesh in libgdx? More specifically, how could I produce shadow volume geometry using the Mesh class of libgdx?
0
votes
0answers
29 views

libgdx ScissorStack problem

Im making a user interface using libgdx I created a Window class & a Textfield class, that both use clipping. I use the ScissorStack class of libgdx for clipping. The Textfield is drawn inside ...
3
votes
1answer
79 views

How do you create a game overlay that makes the underlying graphics inactive?

I've created a simple game, and I drew a large rectangle in photoshop with faded edges that I want to use to overlay the game until the user presses "Begin" (on the overlay). The problem I'm currently ...
0
votes
0answers
11 views

InvocationTargetException caused by IllegalArgumentException due to trying to create a new OpenAL instance

So, after creating this class, (in this LINK) , I ran into a new problem, I recieved an InvocationTargetException, which is generally caused when a method is invoked and an exception is created when ...
0
votes
0answers
47 views

How to open another class by clicking on a button on libgdx?

I have a question about libGdx. I am making my own game, I have already made a splash screen and a main menu. I have made a button "Play" in my menu but I can't link it to my main game. however, I can ...
1
vote
2answers
118 views

Act on Right Mouse Button click on Button

I want to be able to listen for a right mouse click onto a TextButton. Is this possible without removing the default ClickListener of the TextButton? If yes, how? Or should I use a different listener? ...
2
votes
1answer
55 views

Centering a textbutton in a table libGDX

I have a few Tables spread across a Stage, now I have a problem. In one table, all the TextButtons are centered, while in a different one they aren't, like this: Table 1 Table 2 XXXtextXXX ...
0
votes
0answers
24 views

scrolling texture in libgdx

I am making a game using libgdx I need to the space to go forever I have written code but it is not very effective take a look. Look at the code that I used to move the background but I want to use a ...
2
votes
1answer
245 views

How to match font size with screen resolution?

So I'm working on a game using LibGDX, and I have a problem. To make my game fit most resolutions, I created a base asset for each aspect ratio, for example, a main menu background image, I made it ...
1
vote
1answer
54 views

Libgdx - Sprites disappearing [closed]

I'm facing a little problem and I have no idea to bypass it. I've made a dungeon generator and I'm able to spawn randomly mobs, the problem is that when they are not moving the game is fine, but at ...
1
vote
1answer
61 views

Libgdx Box2d createfixture crashes vm intermittently

I have a hard to debug problem. I have a Box2D game which creates a wheeled vehicle. I want the vehicle body to reflect when it goes from moving left to moving right. to do this i set a flag in a ...