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
16
votes
2 answers

Slider always has default width in table

I created a slider inside of a table like shown in the following code example as I know that the minimum width of the background is used for the slider width: public OptionScreen(MainClass game) { super(game); preference = new…
bemeyer
  • 6,154
  • 4
  • 36
  • 86
16
votes
2 answers

Using SVG files with libgdx

I'm planing to create tablet app. I would ask for some guidance. I have pictures in SVG format like this one. With SVG it is easy, You just change fill parameter to different color but as I understand, there is no easy/stable svg processing to use…
tester.one
  • 369
  • 2
  • 6
  • 23
15
votes
3 answers

Convert Spritekit Game to Android?

Are there any new options for converting a spritekit game to android? It seems the only options are to recode everything in Java or to use Cocos2D, LibGDX, etc.
user6025921
  • 165
  • 1
  • 5
15
votes
1 answer

Memory usage in LibGdx

I am in the middle of a huge application in a team of developers and the memory is something to consider early on. When I run the program as it is, it takes about 44 MB of memory (Found from the Task manager). I then create 10,000 bodies. The memory…
Pookie
  • 1,239
  • 1
  • 14
  • 44
15
votes
1 answer

How to add a share intent with robovm (libgdx)?

So for android devices there is a default share intent function that you call that will list all the apps that is downloaded on the device with that allows sharing of content. How would I do this using robovm, here is a Screen shot of what I am…
Edward Lim
  • 763
  • 9
  • 31
15
votes
1 answer

Getting a directory file and the ClassLoader for a libGDX Android game

I have a libGDX game project for Android, and I want to execute a Groovy script in it. To do so, I am examining this example code: https://github.com/melix/grooidshell-example They managed to execute Groovy embed in Java on Android. Particularly…
Saturn
  • 17,888
  • 49
  • 145
  • 271
15
votes
3 answers

Putting Freetypefont into libgdx skin

In my uiskin.json I have this com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: text/default.fnt } } This is fine for when I have the default.fnt in my text folder in the assets folder... However I want to use a Freetypefont. How do…
Seanoseanohay
  • 341
  • 4
  • 19
15
votes
4 answers

Using unProject correctly in Java Libgdx

I want to make a button clickable, but it isn't working - it seems like I need to use unproject() but I can't figure out how. The code in question is: Texture playButtonImage; SpriteBatch batch; ClickListener clickListener; Rectangle…
Chimpanse
  • 250
  • 1
  • 5
  • 17
15
votes
1 answer

Getting Stage coordinates of Actor in Table in libGDX

I want to create a floating help bubble to introduce the basic functioning of my game. This bubble should float above the Actor I want it to explain, like shown in the picture below. To accomplish this, I want the coordinates of the Actor, in this…
Erlend D.
  • 3,013
  • 6
  • 37
  • 59
15
votes
2 answers

is calling libgdx SpriteBatch begin and end method multiple times expensive?

Are the libgdx SpriteBatch begin and end methods expensive for the processor or make the performance slow if I call them multiple times? For example: public void render(float delta) { GL10 gl = Gdx.gl10; gl.glClearColor(0, 0, 0,…
Pogs D Best
  • 223
  • 4
  • 11
15
votes
3 answers

how to drag and drop actors on libgdx scene2d?

I'm developing a game using libGDX and I would like to know how I can drag and drop an Actor. I've made my stage and drawn the actor, but I don't know how to trigger that event. Please try to help me using my own architecture. public class MyGame…
Juan Mitchell
  • 602
  • 1
  • 8
  • 20
14
votes
2 answers

Using the same font with different sizes in libgdx

I am using BitmapFonts, LabelStyles and Labels for my texts. I want to resize some labels, so I use this: fontType.scale(-.6f); LabelStyle style = new LabelStyle(fontType, Color.WHITE); titleLabel = new Label("Points",…
Rudy_TM
  • 1,420
  • 4
  • 15
  • 27
14
votes
2 answers

Particle System libGDX

Can anyone give me a good example of where to start with making a particle system in libGDX? I have looked at the test example in the libGDX source but I am still having trouble getting my head around it. Maybe just a good explanation of it will…
Alex_Hyzer_Kenoyer
  • 1,321
  • 4
  • 17
  • 23
14
votes
1 answer

android studio cannot resolve import org.json.JSONObject

I used libgdx to build my project and I am having issues using the JSONObject class. When I add import org.json.JSONObject, it says it cannot resolve. How do I add that library to my project? Here is what I have tried without success: I downloaded…
Markoh
  • 247
  • 1
  • 2
  • 6
14
votes
3 answers

LibGDX: Reading from json file to ArrayList

I need help with reading json file to ArrayList. I have json file: [ { "name": "Wall", "symbol": "#", }, { "name": "Floor", "symbol": ".", } ] I have a class: public class Tile { public…
Pasha
  • 279
  • 3
  • 11