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 can also be considered a viable framework for desktop applications (stand-alone, applets, Webstart).

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.10.0, which is released in April 2021.

12370 questions
116
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,285
  • 2
  • 8
  • 9
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
  • 5,799
  • 10
  • 45
  • 69
78
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
  • 3,825
  • 1
  • 31
  • 46
58
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: http://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
  • 683
  • 1
  • 5
  • 6
54
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
  • 938
  • 9
  • 21
46
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,778
  • 2
  • 16
  • 28
45
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
  • 1,933
  • 2
  • 21
  • 31
43
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,526
  • 5
  • 39
  • 63
41
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,301
  • 3
  • 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
  • 3,689
  • 6
  • 37
  • 56
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
  • 5
  • 7
35
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
  • 617
  • 3
  • 9
  • 18
34
votes
10 answers

How to draw smooth text in libgdx?

I try to draw simple text in my android game on libgdx, but it's look sharp. How to make text look smooth in different resolutions? My Code: private BitmapFont font; font = new BitmapFont(); font.scale((ppuX*0.02f)); font.draw(spb, "Score:",…
JustOneMan
  • 433
  • 1
  • 9
  • 29
34
votes
2 answers

libgdx difference between sprite and actor

I'm just going through the javadoc and various tutorials on libgdx and I'm at the stage of trying to figure out differences between various concepts that seem similar to me or provide similar capabilities in libgdx. At first I thought scene2d was…
Neil Walker
  • 5,334
  • 10
  • 51
  • 75
33
votes
2 answers

android.os.Bundle cannot be resolved in libgdx Android project

I've just started using Libgdx to practice making games and I used the project creation .jar provided on the site to create the initial projects. However an error shows up in the Android project which says: android.os.Bundle cannot be resolved.…
Coder Shark
  • 427
  • 2
  • 5
  • 13
1
2 3
99 100