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
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
  • 231
  • 1
  • 9
  • 34
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
  • 6,400
  • 14
  • 57
  • 86
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
  • 437
  • 2
  • 5
  • 13
32
votes
10 answers

(when adding jar) - Module "android" must not contain source root

I'm trying to add gdx-tools.jar to a libGDX project in IntelliJ. The result: Module "android" must not contain source root ".../android/src". The root already belongs to module "android". This is what I've tried: project structure > libraries >…
abc32112
  • 2,457
  • 9
  • 37
  • 53
30
votes
3 answers

Could not find class XXX referenced from method XXX.

I'm working on a libGDX project and I have a class called CheerVArachnids that has another inline class which is an event listener. When I run this project on the desktop it works fine. BUT when I run on my Android device, it can't find that inline…
b-ryce
  • 5,752
  • 7
  • 49
  • 79
29
votes
6 answers

Gradle Could not find tools.jar

I am trying to make a game with LibGdx. I love it! It is sooo simple and a lot better than JME3 and LWJGL. But trying to package it I am having an error. Here is an image of the gui for Gradle: http://prntscr.com/845kyx and here is a the full debug…
Fishy
  • 1,275
  • 1
  • 12
  • 26
29
votes
1 answer

Java LibGDX BitmapFont setScale method not working

I am currently trying to scale a font but I am receiving the error "the method setScale(float, float) is undefined for the type BitmapFont" This is the code section where I am getting the error, specifically in lines 2 and 4. font = new…
BlastBeats
  • 315
  • 3
  • 4
28
votes
3 answers

Understanding the libGDX Projection Matrix

Over the past few weeks I've been attempting to learn the libGDX library. I'm finding it hard, especially for my first endeavor toward game development, to comprehend the system of Camera/viewport relationships. One line of code that I've been…
user3059686
  • 423
  • 2
  • 5
  • 10
27
votes
3 answers

How get a string width in Libgdx?

I wonder know how to get the width of my string in pixels
LeSam
  • 1,235
  • 4
  • 18
  • 38
27
votes
3 answers

Libgdx setup UI gives 2 unexpected errors in new GWT project

I have run the setup ui, however, I get two different errors in the -html project than what is described in the tutorial: libgdx tutorial The tutorial error stated is as follows (which is an error I do not see): To fix the error of the HTML5/GWT…
BigBug
  • 6,202
  • 23
  • 87
  • 138
26
votes
1 answer

WebGL and Chrome: high resolution makes for bad performance

I have an application created with LibGDX. I can run the application on the desktop and it runs at 90 fps @1080p. On Firefox it runs at 40-50 fps @1080p (maximized window). On Chrome it runs at 30 fps @1080p (maximized window). However on Chrome, if…
RobotRock
  • 4,211
  • 6
  • 46
  • 86
26
votes
1 answer

LIBGDX: What is a "viewport"?

This post is related to an earlier post of wanting to learn how to properly render in between LIBGDX and Box2D. I had to understand viewport well before I could proceed. After much code/post readings, I felt the meaning of "viewport" was "the…
coffeenet
  • 553
  • 1
  • 7
  • 17
25
votes
4 answers

How to add libgdx as a sub view in android

I have main.xml as follows: ...
24
votes
3 answers

Actions of Actors in libgdx

I have made my Actor, but I am unclear on how to take advantage of the action and act methods. Outside of the basic Javadoc, I have not found a good tutorials on these methods. Can anyone provide an example with comments for actions on actors?
Rudy_TM
  • 1,420
  • 4
  • 15
  • 27
24
votes
5 answers

How set Libgdx bitmap font size?

I'm rendering on screen the game fps using bitmap font but there are no methods for the size. This is a problem for me because my camera viewport size is very small so the text when rendered is huge and pixelated. font.draw(batch,…
Kevin Bryan
  • 1,846
  • 2
  • 22
  • 45