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
32 views

Libgdx, actor touchlistener not working

public class Main extends ApplicationAdapter { SpriteBatch batch; OrthographicCamera camera; Stage stage; Image greyback; Image circle; private float width; private float height; @Override ...
3
votes
1answer
127 views

Creation of a tiled map editor polyline in box2d is not working correctly

I'm currently trying to create a box2d polyline object in my libgdx game, but it's not working as expected. To get a better picture of my subject, have a look at how it should look like, and how it ...
6
votes
2answers
2k views

SQLite in libGDX

Does anyone have an example of how I can use SQLite in libGDX? I have a class in my original Android code that allowed me to easily access a database but I can't seem to find anything equivalent to ...
-1
votes
0answers
34 views

Implementing gesture detection in LibGdx

How do I add a long press input to my libgdx game. here is my failed attempt: public class PlayState extends State implements GestureDetector.GestureListener { private Protagonist bird; ...
6
votes
1answer
159 views

How to detect collision only in non-transparent texture?

I am developing a game using libgdx. I am trying to detect the collision between bee and tube. I am using the following code to detect the collision. if(player.getBounds().overlaps(boundsBot)){ } ...
0
votes
1answer
216 views

How to zoom and scroll in libGdx?

I am trying to both A.) Pinch zoom my game scene and B.) Move (scroll) my game scene but I have not found many examples. I learn more by examples than by reading API documentation (although I am ...
0
votes
2answers
74 views

Round position to center of current grid position

The title may not make sense, nor may the question - I'll try nevertheless. I'm attempting to make a game similar to The Powder Toy. Essentially, this is a physics simulation game, where the users ...
0
votes
0answers
102 views

Box2dMapObjectParser isometric map - bodies have wrong position and size

I'm using Box2dMapObjectParser to load Tiled objects layer onto my IsometricTiledMapRenderer'ed TiledMap. It works OK with a UnitScale of 1 but the position is wrong and some shapes have weird ...
-1
votes
0answers
9 views

How do I increase or decrease the background movement speed (libgdx) [on hold]

I making a game using libgdx and I want to know how to increase or decrease the background movement speed this is what i tried public class PlayState extends State { private int tubeSpacing = ...
0
votes
1answer
25 views

LibGDX: Transition scale bitmap font

I'm trying to create a Minecraft like quotes on the menu screen of my game. I'm using BitmapFont to draw the text on screen but i don't know how to make that scale up scale down effect. This is what ...
1
vote
1answer
55 views

How to handle two players playing on one keyboard with Box2D (LibGDX)?

I'm making a racing game with LibGDX and Box2D. I've been using this tutorial to implement the basic physics, and it works properly. My main problem is to implement two different sets of keys ...
1
vote
0answers
13 views

How to force libGDX to set display mode?

The following code represents my attempt to switch display modes. I've had to include the redundant setWindowedMode because without it, libGDX would not force the change required to reflect the ...
6
votes
3answers
3k views

LibGDX keep camera within bounds of TiledMap

I have a simple TiledMap which I can render fine. I have a player hopping (with Box2D) around and my camera follows the player around: cam.position.set( player.position().x * Game.PPM + ...
0
votes
1answer
21 views

TiledMap renders but gets duplicated when I move the camera

I've created a map (TMX file) using Tiled, imported it and it shows great but when I move the camera, it duplicates itself and the whole screen flickers. In Tiled, I didn't use a spritesheet but ...
1
vote
1answer
96 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
873 views

Changing Box2D Body from Kinematic to Dynamic after contact

What is the correct way to change a Kinematic body into a dynamic body? context - I have a dynamic body as a projectile which has to be fired at a kinematic body (it is kinematic because i am ...
0
votes
0answers
5 views

Libdgx and Overlap2D export settings for Android

So I have a problem when exporting assets from Overlap2D to Android Studio project location. When setting up libgdx I set the project to be for desktop and android and selected Overlap2D extension. ...
0
votes
1answer
533 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 ...
2
votes
4answers
220 views

How to make sure that when two bodies collide, there is only one collision detection on box2d?

I'm using LibGDX with Box2D and, when two bodies collide, the collision is detected multiple times. Here's the code: public void preSolve(Contact contact, Manifold oldManifold) { Body a = ...
-1
votes
0answers
16 views

How to make the interaction of sensors is in box2d? [on hold]

can not figure out how to make the interaction of the sensor platform has become active. something like this: BeginContact { if (sensorA && sensorB){ platform.getBody () ...
2
votes
1answer
92 views

Get array from JSON in Libgdx?

I wanted to load in map information using JSON, is there a way to get String, Int, float etc lists or arrays from JSON in Libgdx? My structure looks like this { "data": [{ "name": ...
2
votes
1answer
70 views

LibGDX How do I create a Shop?

My game is fully working but now I want to make a shop so that the player can buy boosts or other useful stuff for the money the player has collected. What is the best way of doing this kind of ...
1
vote
1answer
54 views

ScreenSize vs. WorldSize

While programming a game with LibGDX, I came across a problem. My OrthographicCamera wasn't centering in the right place. I was trying to center the camera by using the line of code: ...
0
votes
2answers
576 views

Can't work with universal tween engine while having added it to gradle

I'm actually developing a game with libgdx and I'd like to create a splash screen. To do this, I must use the Universal Tween Engine. To add the Universal Tween Engine, I followed the instructions of ...
3
votes
2answers
1k 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 ...
0
votes
1answer
267 views

LibGDX make an object rotate around something

I need to rotate and object, which should be a circle made up with a ShaderRender, around a specified point. In LibGDX there is a method or something which allow me to do this? If it doesn't exist how ...
0
votes
3answers
48 views

How to scale bitmap font without having it pixelated

How do i increase the size of a bitmap font without having it get pixelated, in libgdx?
1
vote
1answer
152 views

Switch beetween Screen on LibGdx application

i have set main class like this: public class MyClass extends Game { MenuClass menuClass; ActionGame actionGame; @Override public void create() { menuClass = new MenuClass(this); ...
0
votes
0answers
5 views

LibGDX Child node is not following animation

So I'm trying to place a golf club as a child node of the hand of our "golfer", so it follows the animation the golfer has when the animation is invoked. However, once I hit "Check Swing" (the button ...
0
votes
1answer
63 views

libgdx limit angular speed

I'm working on my top-down game. y characters use pathfinding + steering behaviors(Arrive and FollowPath) to move. I've implemented my character class from libgdx SteeringActor class (from tests). So ...
0
votes
2answers
611 views

Basic 2d platform collision detection algorithm has a slight bug (Java)

I'm trying to implement collision detection between Player (the main character) and a Platform. They are both modelled as rectangles; when player hits the side of a platform he should bounce off it ...
0
votes
1answer
61 views

Network interpolation wont work for local player

im currently developing a little duengon crawler. It should have lan multiplayer and it works great but i think im sending to much packets. Should i send packets over network, when a player moves in ...
1
vote
1answer
64 views

Centering an animation [libGDX]

I have the following class: public class AnimationDemo implements ApplicationListener { private SpriteBatch batch; private TextureAtlas textureAtlas; private Animation animation; ...
1
vote
0answers
43 views

Libgdx stops all sounds when there are lots of sounds

I'm making a 2D game for Android using Android Studio with Libgdx in Java. I have a class, called SoundPlayer, which holds an ArrayMap. The key is the name of the sound file and the value is the sound ...
0
votes
0answers
28 views

How to split a screen in half using LibGDX without scaling?

I am currently working on a racing game with libGDX and I need to split the screen in half for a two-players mode. (Player 1 in first half and Player 2 in second half). I already have Camera1 that ...
0
votes
0answers
54 views

How to update projectile trajectory point?

I am a new game developer, I am making a game, but I have a problem, I don't know how I can update my trajectory point in OnDraw method. Could anyone please help me? Thank you! Here is my code: ...
5
votes
2answers
591 views

Main game objects as static

I'm making a game for Android using Android Studio with Libgdx in Java. In my game there are main object like Screen, ObjectFactory, SoundPlayer, Painter (Responsible for drawing) and a few more. 'til ...
0
votes
1answer
105 views

Raycasting. Corner trap

In my top-down game character moves to target (pathfinding) also avoiding obstacles with Raycasting(Central ray with whiskers), but situation like on picture causes shiver and unneeded turning ...
1
vote
1answer
38 views

Box2D fixed timestep updating is twitchy on constant FPS

I'm messing around with libgdx and box2d and I'm trying to implement sidescroller movement with fixed timestep logic according to the famous Fix Your Timestep! tutorial/guide. However, logic updating ...
0
votes
1answer
13 views

InputProcessor without stage

I have a GameScreen where I'd like to have a pause button. I've tried using an Image with a listener, but since my GameScreen isn't a stage, I can't use that in the inputProcessor. So my question is ...
1
vote
2answers
516 views

LibGDX particle emitter rotation

I have a libGDX game, in which I'd like to make some ice breath like effect using particles. So far we made a cone like effect. I can obtain and render it on the screen with this. ...
-1
votes
0answers
19 views

Could you help find the error in this Cryptic crash log from Lidgdx game engine [closed]

This is crash log I get sometimes, when I run the libdgx game. The game uses Box2d physics engine. Here is the file content : http://pastebin.com/raw/FT43RKzk
0
votes
0answers
21 views

TiledMap Safe Area for different screen resolutions

I'm creating a Tower Defense game using libGDX (w/ scene2d) and TiledMap. I've been reading extensively about viewports and how I can better manage various screen sizes. I want my Tiled Map to take ...
0
votes
1answer
69 views

How could I draw text in an 'info bubble' with libgdx?

I am making an android game using libgdx where there are textures on the screen which represent people. When you touch a person sprite I want a little info bubble to pop above their head displaying ...
0
votes
1answer
43 views

Simplifying Object Factory

I'm making a game for Android using Libgdx with Android Studio in Java. In my game, I have a class called ObjectFactory which has a method createGameObject(int objectType) which receives an integer ...
2
votes
2answers
737 views

Card game - creating card Listener

I am making a card game where there are 21 cards on hand and 2 options from where user can draw cards to his hand and throw a card from hand. I am new on game development and I'm following the ...
3
votes
2answers
258 views

LibGDX - Can't read .ttf file when running Android configuration

when running or debugging my game on android device, i get this error in the logcat: com.badlogic.gdx.utils.GdxRuntimeException: Error reading file: data/fonts/myFont.ttf (Internal) which is ...
1
vote
1answer
88 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 ...
0
votes
1answer
24 views

LibGDX - Bundling Files

I have 3 files. A JSON file, a PNG file, and a TXT file. Is there any possible way I can put all three inside a common file with a custom extension? (for example "fileName.abc") I searched the web a ...
6
votes
1answer
568 views

Word game - board implementation?

I'm working on a boggle type game for android, using libgdx. The user is presented with a 4x4 grid of letters and must find words by dragging their finger over the letters. Unlike boggle I want used ...