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
117
votes
9 answers

"File not found" when running new LibGDX project

I trying to learn LibGDX, I install all the software listed here with a new Eclipse 4.3 on a fresh formatted mac OS X Maverick. Everything goes smooth, after a reboot, I download, and execute the gdx-setup.jar, fill the form, and import into…
lebill
  • 1,293
  • 2
  • 8
  • 9
85
votes
14 answers

Failed to resolve: com.google.android.gms:play-services in IntelliJ Idea with gradle

I'm trying to add google play services to my libGDX project in IntelliJ Idea. I've followed the setup guide here: https://developers.google.com/android/guides/setup which looks pretty straightforward. I just added those lines to my build.gradle in…
Fran Marzoa
  • 4,293
  • 1
  • 37
  • 53
81
votes
7 answers

How to deal with different aspect ratios in libGDX?

I have implemented some screens using libGDX that would obviously use the Screen class provided by the libGDX framework. However, the implementation for these screens works only with pre-defined screen sizes. For example, if the sprite was meant for…
Rafay
  • 6,108
  • 11
  • 51
  • 71
59
votes
6 answers

Changing the Coordinate System in LibGDX (Java)

LibGDX has a coordinate system where (0,0) is at the bottom-left. (like this image: https://i.stack.imgur.com/jVrJ0.png) This has me beating my head against a wall, mainly because I'm porting a game I had already made with the usual coordinate…
Sosavpm
  • 693
  • 1
  • 5
  • 6
55
votes
2 answers

Creating an iOS library or framework using libgdx (roboVM)

Is it possible to create an iOS library or framework using libgdx (RoboVM) that can be imported into Xcode? Background: One of my colleagues has created a 3D visualisation app as a libgdx project for android and windows desktop. It can be compiled…
Wayne Shelley
  • 992
  • 10
  • 25
48
votes
4 answers

In libgdx, how do I get input from the back button?

For my game, I'd like the Android back button to take you to the pause menu, instead of minimizing the game. From what I've googled, I know I need to call Gdx.input.setCatchBackKey(true); But how do I actually check for the button press?…
Dmiters
  • 2,011
  • 3
  • 23
  • 31
48
votes
2 answers

Default Skin LibGDX?

I've been following this: https://code.google.com/p/table-layout/#Quickstart to get a little introduction to tables in LibGDX. I already experimented around a little with buttons. Now I have this code: Label introLabel = new Label("Skip Intro",…
AreusAstarte
  • 1,958
  • 2
  • 17
  • 29
45
votes
4 answers

Drawing transparent ShapeRenderer in libgdx

I have a drawn a filled circle using ShapeRenderer and now I want to draw this circle as a transparent one. I am using the following code to do that: But the circle is not coming as transparent. Also, I checked th libgdx API and from the wiki, it…
UVM
  • 9,776
  • 6
  • 41
  • 66
43
votes
5 answers

TrueType Fonts in libGDX

Does anyone know how I can use a TTF font in libGDX? I have looked around and have seen things about StbTrueTypeFont but it doesn't seem to be in the latest release. EDIT: I found the StbTrueType font stuff, the jar file is located in the extensions…
Alex_Hyzer_Kenoyer
  • 1,321
  • 4
  • 17
  • 23
37
votes
2 answers

libgdx SpriteBatch render to texture

Is it possible to render to texture using SpriteBatch in libGdx (Java engine for Android/Desktop)? If so, how do it? Basically I want to render everything to 320 x 240 region of 512 x 256 texture and than scale region to fit screen (in landscape…
PiotrK
  • 4,210
  • 6
  • 45
  • 65
37
votes
3 answers

How do I troubleshoot "Inconsistency detected: dl-lookup.c: 111" (Java Result 127) error?

I'm currently trying to build a Java project using Maven for a libGDX game I'm working on. I think I'm using Java 8 OpenJDK (1.8.0_211) on a Ubuntu 18.04 LTS distribution. The related question debugging ld, "Inconsistency detected by ld.so" was not…
user11409887
37
votes
4 answers

How can I draw text using Libgdx/Java?

I've been having a lot of trouble Googling how to draw simple 2D text with Libgdx. Here is the code that I've put together so far: SpriteBatch spriteBatch; BitmapFont font; CharSequence str = "Hello World!"; spriteBatch = new SpriteBatch(); font =…
Asgeir
  • 727
  • 3
  • 9
  • 20
35
votes
8 answers

java and libGDX / LWJGL game fullscreen wrong size for multiple monitors on Ubuntu

I'm working on a libGDX (library on top of LWJGL) game project, and use the Intellij IDEA IDE from several different workstations: Windows 7 x64 laptop with two displays (1920x1080 and 1600x1200), nVidia GT540M. Ubuntu 12.04 LTS on a laptop with…
Shad
  • 576
  • 6
  • 7
34
votes
7 answers

General error during semantic analysis: Unsupported class file major version 57

I'm trying to setup libgdx for a desktop game and when I try to generate the project I have this error and the build fails. I've the latest versions of Java(13.0.2) and Gradle(6.6), both set as environment variables in the path. Can somebody help…
Noemi
  • 341
  • 1
  • 3
  • 3
34
votes
3 answers

How to create a button in Libgdx?

I want to create a button that changes when the user hovers it, or clicking it. I created the following variable Button buttonPlay = new Button(); I don't know what to do now, how to load the images? How to write text into the button? How to…
julian
  • 4,634
  • 10
  • 42
  • 59
1
2 3
99 100