Questions tagged [libgdx]

'libGDX' is an open-source cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux, Mac OS X, Android, iOS and WebGL enabled browsers.

The libGDX project is a cross-platform (Windows, Mac OS X, Linux, Android, BlackBerry, HTML5, and iOS) game development library written in Java with some JNI code. It abstracts away the differences between the different platforms and enables easier development of OpenGL-based games on them.

'libGDX' is an open-source effort, started by Mario Zechner in late 2009/early 2010. In its original form it was an attempt at a rapid prototyping library which avoids the slow development cycle usually encountered when creating pure Android applications. The goal was to be able to work mostly on the desktop, and only deploy to the emulator/a device when absolutely necessary.

'libGDX' now is a multi-backend, cross-platform game development library which is not only targeting Android, but it can also be considered a viable framework for desktop applications (stand-alone, applets, and Web Start).

It includes a wrapper to work directly with (2D physics). And one for (3D physics).

Please note that there's a rich community on the official forum, and an official wiki.

The current stable version is 1.11.0, which was released in May 2022.

12609 questions
24
votes
1 answer

@Named providers with same return types end up giving java.lang.IllegalArgumentException: Duplicate

Here is the issue, I am working on a LibGDX project where i have different modules for different platforms. This is how my android module looks like: @Module( includes = {BaseModule.class, NetModule.class}, injects =…
24
votes
2 answers

How to render Android's YUV-NV21 camera image on the background in libgdx with OpenGLES 2.0 in real-time?

Unlike Android, I'm relatively new to GL/libgdx. The task I need to solve, namely rendering the Android camera's YUV-NV21 preview image to the screen background inside libgdx in real time is multi-faceted. Here are the main concerns: Android…
Ayberk Özgür
  • 4,986
  • 4
  • 38
  • 58
24
votes
1 answer

When to use actors in libgdx? What are cons and pros?

I'm writing simple solar system simulator. This is my first libgdx project. I'm using a Stage and Actors for the main menu and is pretty handy especially touch events handling. But ... looking at the examples i see nobody uses actors in actual game…
Lord_JABA
  • 2,545
  • 7
  • 31
  • 58
23
votes
1 answer

Libgdx game crashes on Android

I made a game using libgdx and it runs fine on both desktop and android before. I'm not sure if its because I started using box2d physics engine and liquidfun particles,what basically happens is that when I click play on my game it start loading…
Kevin Bryan
  • 1,846
  • 2
  • 22
  • 45
23
votes
8 answers

libgdx or playn?

I'd like some help chosing a framework for cross platform mobile game development. I have narrowed it down to libgdx and playn I plan to make games mainly targeted for Android but i would also be able to release them on ios and as html. I know that…
wanner
  • 277
  • 2
  • 5
22
votes
4 answers

Can't change font color in Libgdx

I'm trying to change the color of the font I use in my application. But whatever I try the font remains black. I made this font using Hiero font tool. My code is something like this: SpriteBatch batch = new SpriteBatch(); BitmapFont font = new…
ruff1991
  • 803
  • 3
  • 9
  • 16
22
votes
2 answers

Button ClickListener is not working in LibGDX game

I am developing an Android game using LibGDX. There are 4 buttons in a menu screen, but the ClickListener of these buttons is not working. // retrieve the custom skin for our 2D widgets Skin skin = super.getSkin(); // create the table actor and…
sandee
  • 349
  • 1
  • 4
  • 16
21
votes
2 answers

Error:(2, 0) Plugin with id 'jetty' not found

Yesterday I upgraded Android Studio to version 3.0, but I'm working with LibGdx and after the upgrade I cannot build my project. When I'm try to build, it gives me an error: Error:(2, 0) Plugin with id 'jetty' not found How should I fix this?
B. Eugenio
  • 313
  • 1
  • 2
  • 5
21
votes
3 answers

LibGDX antialiasing

Is there a way to implement antialiasing in LibGDX? My lines are very pixilated.
ComanderKai77
  • 460
  • 6
  • 14
21
votes
2 answers

Unity vs Libgdx vs Cocos2d-x

I'm a Android and a Software Programmer. Currently I know three languages C++, C#, Java. Now I want to make games as well. After searching the Internet I got the names of these three engine, so which engine should I use for game development for…
Bhavya Maroo
  • 237
  • 1
  • 2
  • 7
21
votes
2 answers

How to do blending in LibGDX

I basically want to play around with blending modes in LibGDX but don't know how to do it. I found this image on internet. I want to do the same thing on LibGDX. Can someone teach me how. I've been playing around using Scene2D. Here's my…
Ezekiel Baniaga
  • 853
  • 1
  • 12
  • 26
21
votes
5 answers

How to get screen resolution of an android device using LIBGDX?

I am working android game development and I am new in it. I want to develop a game which screen resolution free. It will be enough for me if i get to know that how to catch screen resolution of an android device using libgdx library. After some…
mfs
  • 3,984
  • 6
  • 32
  • 51
21
votes
1 answer

Difference between libgdx Stage and Screen

I'm making a game, and I see in tutorials some people using Stage class, and others using the Screen class, but I can't figure out the diference.
Juan Mitchell
  • 602
  • 1
  • 8
  • 20
21
votes
2 answers

How to make a smooth camera follow algorithm?

I am making a game with LibGDX (Java). I need the camera to follow a fast moving character. The easiest way to do it is to just write this: this.getCamera().position.set(obj.x, obj.y, 0); But, is there any algorithm to make this more smooth? Like…
Avetis Zakharyan
  • 887
  • 2
  • 9
  • 20
21
votes
2 answers

Unexpected results implementing simple motion blur in Libgdx

In the two attached pictures, the desktop screenshot of libgdx functions as expected. The screenshot from my Galaxy Nexus is unfortunately not as expected. I am attempting to create a simple motion blur or trail effect. Rendering as I expected on my…
ian.shaun.thomas
  • 3,468
  • 25
  • 40