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

Sprites not being rendered on screen change - Android Libgdx

In my game over screen for my Libgdx Android game I've the following code which starts a new game upon a screen touch. if(Gdx.input.isTouched()) { ScreenManager.setScreen(new ...
1
vote
1answer
86 views

Is there any case to mix Android UI with LibGDX?

my question is about creating "non-playable" screens in games with the help of native android tools. For example, I have an Android LibGDX game (singleplatform), what should I use to provide start ...
-1
votes
1answer
32 views

libGDX's 2D particle editor launching incorrectly

What's going on? Here's my process: I first right-click the referenced library for gdx-tools.jar in Eclipse: I then search for the particle-editor class: It opens successfully, but half of the ...
0
votes
1answer
688 views

Communication between Box2D and libGDX Stage (Scene2D) running in separate threads

I'm making a physics based 2D game using libGDX and Box2D. I want to move the execution of the simulation out of render thread. I use immutable messages and the BlockingQueue to pass the information ...
0
votes
0answers
17 views

Libgdx - How to change GestureListener pan finger sensibility?

I implemented GestureListener in my Overlap2dStage to pan the camera when the player drags its finger over the screen. But I also have some actors that extend InputAdapter to detect when the user ...
1
vote
1answer
51 views

(Java) Trying to animate an arraylist of coins with a (working) animation class

I have a coin class which takes in an integer numOfCoinsand an enum LayoutType, which can be linear or curved. A linear layout displays the coins in a straight line one after the other - we'll work ...
1
vote
1answer
174 views

How do I reverse this function?

I'm working on an isometric tile rendering engine and I need to reverse a function I used to translate the Cartesian coordinates into isometric coordinates. I've already written a function for this, ...
0
votes
0answers
62 views

player sprite hidden after using a stage (scene2d library)

What i'am doing is showing a tiledmap on the full screen , and it works fine. The character moves perfectly and the camera too. What i want is : Showing some text or imageButton over the map like ...
1
vote
0answers
59 views

Using Box2D in LibGDX, is there a reason a fixture set to be a sensor would only -sometimes- detect a collision?

I am working on a 2D game in LibGDX. Currently, I am testing interactions between a player's weapon and enemies - in particular, a sword and an enemy monster. The player has a hurtbox and the sword ...
2
votes
1answer
225 views

2d libgdx: runtime level generation

I have encountered a problem during my first game development: I thought of a Array<Ground> groundArray that does groundArray.add when a new ground will appear on the screen, and removes oldest ...
-3
votes
3answers
181 views

Using a basic shader in libGDX

Looking at https://github.com/libgdx/libgdx/wiki/Shaders, I have decided to try these shaders: String vertexShader = "attribute vec4 a_position;\n"+ "uniform mat4 ...
2
votes
1answer
47 views

LibGDX font issues

I've started creating a small project for the store with LibGDX. So far I only tested on PC, and everything went well. I'm using the gdx-smart-font library for font rendering. The fonts are looking ...
0
votes
1answer
32 views

LibGdx: How to check if VSync is enabled

I am just about finished my options screen, the only thing I need is some way of detecting if Vsync is enabled or not. I'm using LibGdx 1.5. I have tried to find an access to wglSwapIntervals, but ...
0
votes
0answers
60 views

Dijkstra Pathfinding in Libgdx, some minor problems

I'm having some problems with my Dijkstra implementation in Libgdx. I understand that there are already AI libraries that can probably do this much simplier but this is a school assignment so i'm ...
0
votes
2answers
78 views

Is using Game in libGDX for more than just switching screens a bad practice

I'm the process of refactoring the prototype of my game to use multiple screens using the Game - Screens model. I found some information (I think in more than one place) that the Game class should be ...
0
votes
1answer
154 views

Why does my libgdx app just display the badlogic.jpg instead of my start screen? [closed]

I have been looking at example libgdx games. It looks like https://github.com/libgdx/libgdx-demo-cuboc is the closest thing to a game I would like to make. I am able to download, compile and execute ...
1
vote
1answer
40 views

OrthographicCamera and viewport not giving expected effect

I recently asked a question about this area that I think was too broad, so I will try a new approach. I have the following code I am experimenting with: batch = new SpriteBatch(); ...
0
votes
0answers
30 views

How to resize animation in libgdx?

I want to draw an animation, the size of each frame is 500x500px but when I try to resize, the animation seems to rotate... Here the code to load frames and create animation: Texture fireSheet = ...
0
votes
0answers
32 views

Scaling buttons in LibGDX

I'm trying to make a usable GUI for a Android game using LibGDX. But I'm having big trouble getting the fonts and buttons to a usable size. Scaling fonts work, but the results are not very pretty. ...
1
vote
1answer
131 views

LibGDX problems when switching screens and disposing: AL lib: (EE) alc_cleanup: 1 device not closed [closed]

I have to classes which implements the Screen interface. I'm trying to switch between these screens. I'm able to switch one time, but when trying to switch back, I receive the error: AL lib: (EE) ...
0
votes
0answers
26 views

Can't perform normal jump after applying revolute joint

I have encountered the following problem: I have two PolygonShapes which I had connected with a RevoluteJoint. The first body is called square the second is called weapon, before connecting the two ...
0
votes
0answers
24 views

LWJGL: getDisplayModes() on Linux with two monitors

When calling getDisplayModes() on a Linux machine with two monitors I only get one single resolution, that is, the current resolution set on the main monitor. However, calling xrandr directly gives me ...
2
votes
2answers
392 views

Since Table.drawDebug is deprecated in libGDX, what should I use instead?

I am following the "Learning LibGDX Game Development" book to make a simple game. I am in the menu creation section where we create a stage and render it with debug borders. The book says to use ...
0
votes
1answer
40 views

Animation reset in libgdx

i have an issue that i hope it's easy to resolve. I'm playing various animations in my libgdx-created game. For a particular animation, i need that to play in loop mode but only if a particular ...
0
votes
0answers
23 views

Libgdx. Sprite won't stop moving;

I can't stop a sprite from moving. Here's my code: boolean moving; Gdx.input.setInputProcessor(new Input(){ public boolean touchDown(int screenX, int screenY, int pointer, int ...
1
vote
0answers
78 views

LibGDX Box2D Lights - Illuminate background

I have a box2D world made of tiles. I use a custom DirectionalLight for light up the scene from above (It shines through transparent blocks [eg.: the water] more deeply). The problem is (as expected), ...
0
votes
0answers
17 views

Problem of textureRegions display after display two screens

I have a texture display problem, knowing that they display correctly in the desktop project and before packer textures. but once I packed textures, they still appear in the first screens((enuScreen ...
1
vote
0answers
87 views

Libgdx simple movement with velocity [closed]

Ok so this is driving me nuts. I've followed 3 tutorials now and I'm trying to get simple velocity to work and it just doesn't want to work for me. I have an open space and I want the character to be ...
1
vote
1answer
103 views

LibGDX Android Application only running once

I'm having trouble trying to figure out why my LibGDX game only runs successfully once on Android. Assuming the game has not been installed on the device, when I run the application from eclipse the ...
0
votes
1answer
41 views

Valid instances not drawn [closed]

i have a problem with my code, my valid instances aren't drawn. I'm just at the beginning so i will post the whole code(which sounds bigger than it is)..just a few lines public class MyGame ...
0
votes
0answers
69 views

Images not scaling properly in LibGDX when using “batch.setProjectionMatrix(camera.combined);”

I am trying to put Assets into my game but when i put in the line of code "batch.setProjectionMatrix(camera.combined);", which from my knowledge scales the Asset to the size of the window it appears ...
1
vote
1answer
46 views

LibGDX/Java - Trying to find the vector from one object to another

I want to add springs in my game that work like the ones in sonic - i.e. if you can't get over an obstacle you have to hit a spring which sends the main character flying towards another spring that ...
0
votes
0answers
29 views

Rendering dialog in libgdx.

Here's what I'm doing: public void create() { float w = Gdx.graphics.getWidth(); float h = Gdx.graphics.getHeight(); camera = new OrthographicCamera(); camera.setToOrtho(false, w, ...
0
votes
1answer
175 views

LibGDX: Scrollpane won't scroll to bottom after adding children to contained table

To my game I want to add a gui element that displays text and textButtons whenever something is happening or it wants you to make a decission (an answer while talking to a person for example). To keep ...
-1
votes
1answer
49 views

Sprite movement only works the first time, can't figure out why [closed]

In my libGDX game I have finally managed to get the sprite to move the way I want him to but for some reason my desired outcome only works the first time I run the code. If I try to run it again, he ...
0
votes
1answer
55 views

LibGDX how to efficiently handle button presses

I'm making a simple 2D game for android using LibGDX. My game needs to have many buttons in it that fire off a method when pressed, and I was wondering what the best way to do this would be. I tried ...
4
votes
1answer
4k views

What are the differences betwen Texture, TextureRegion, TextureAtlas, Sprite and Image in libgdx?

I've searched around for tutorials. I've seen people using the above classes to load images. As according to my understanding, all of the classes can read in a non-power of two images, ...
1
vote
1answer
129 views

LibGDX scene2d good practices

I'm developing a game using LibGDX and in a part it has a pretty complex UI for profile selection and stuff. I have some general problems. I'd like to know good practices when generate good looking ...
1
vote
2answers
210 views

Are shaders the only way to implement 2d lighting?

I'm working on a 2d top down game with libgdx and I think i got the basics. No want I want to implement lighting, I don't know anything about lighting. I want just to have some light sources and ...
3
votes
2answers
3k 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 ...
0
votes
1answer
231 views

Using SVN with Libgdx

I decided to give LibGDX a try and am planning to use SVN for my code repository. I created my LibGDX project via the Gradle build as outlined in the book "Learning LibGDX Game Development". I'm not ...
0
votes
2answers
81 views

Why does this simple if-statement that checks my main characters state never get called (Java/LibGDX)?

Been working on this for a while - basically I want my player to perform a front flip when he jumps (screen tap -> player jumps). I wrote the animation class Animator (extends Player implements ...
0
votes
0answers
69 views

Using Blender to define physics objects for libGDX

I'm in the early stages of building a game using libGDX. The game is 3D and will use Bullet physics (gdx-bullet wrapper). I have a 3D scene loaded and have manually created some physics objects which ...
5
votes
2answers
1k views

Is it legal to pack LibGdx libraries in my jar file? And to obfuscate them?

I'm using LibGDX and deploying a runnable jar file, using the Eclipse feature, with libraries extracted into it. There are also .so files and .dlls inside. Is it legal to do so? I didn't find ...
1
vote
1answer
667 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
0answers
33 views

Partitioning a Tiled map

In my 2d platformer with libGdx, my maps are quite large (eg. 200x200). The player character is only 2 tiles high. I use Box2d for collision, so in my tiled map I have layers for terrain, ...
-1
votes
1answer
69 views

How can I implement input handling into my game?

I'm making a libgdx game where the player dodges falling objects. To move the player I have it set so that on desktop he moves left and right when you press A and D respectively. I am trying to ...
0
votes
0answers
46 views

Sprite collision Rectangles LibGDX

I have a big problem with my sprite top collision. Here ismy constructor public CoolGuy(){ full = new Rectangle(0, 0, 50, 98); bottom = new Rectangle(0, 0, 50, 15); top = new Rectangle(0, ...
2
votes
1answer
106 views

Box2D Lights - Simulate water

I have a libGDX project, in which I have a Box2D world, which is currently filled with some boxes as a terrain. I also added a DirectionalLight to the scene for simulating the Sun. I almost have the ...
0
votes
0answers
20 views

Cannot instantiate the type BodyEditorLoader

Hello I'm trying to use BodyEditorLoader in my game BodyEditorLoader loader = new BodyEditorLoader(Gdx.files.internal("data/test.json")); But I get this error Cannot instantiate the type ...