Questions tagged [libgdx]

LibGDX is a cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux, Mac OS X, Android, iOS and your WebGL enabled browser.

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 (LibGDX Github page), 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 box2d (2d Physics). And one for bullet (3d Physics).

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

2286 questions
25
votes
5 answers

How do I make an on-screen HUD in libgdx?

I'm new to libgdx, and I am finding I am getting stumped by the simplest of things. It seems to want me to do things a specific way, but the documentation won't tell me what that is. I want to make a very simple 2d game in which the player controls…
Devin Carless
  • 251
  • 1
  • 3
  • 3
14
votes
1 answer

What are the differences betwen Texture, TextureRegion, TextureAtlas, Sprite and Image in libgdx?

I've searched around for tutorials. I've seen people using the above classes to load images. As according to my understanding, all of the classes can read in a non-power of two images, TextureRegion/TextureAtlas are usually used to load sprite…
user15783
  • 347
  • 1
  • 3
  • 8
11
votes
2 answers

Since Table.drawDebug is deprecated in libGDX, what should I use instead?

I am following the "Learning LibGDX Game Development" book to make a simple game. I am in the menu creation section where we create a stage and render it with debug borders. The book says to use Table.drawDebug(stage) but this static method seems to…
Shijima
  • 377
  • 3
  • 14
9
votes
2 answers

How to draw table border in libgdx?

I'm new to libgdx and I'm currently working on TableLayout and wondering how could I draw borders for each cells. I've done some research on this but it seems that I could come up with this solution…
user15783
  • 347
  • 1
  • 3
  • 8
9
votes
1 answer

How do I draw a name above monsters head?

My player HUD works perfect, but when I move, the monster name moves with me instead of getting attached to the monster. Player has a HUD and I'm using Scene2D.ui to pull it off and works great. I use unit scale, that's why I got 2 camera. One for…
Printer
  • 317
  • 2
  • 11
8
votes
1 answer

How to create groups in libGdx?

Can any of you please demonstrate a simple example on how to use groups in libGdx ? so if i move the parent, then all the children will move with it and same goes for rotation and scaling. I looked for tutorials and example online but it seems that…
alaslipknot
  • 472
  • 6
  • 18
8
votes
1 answer

Shaperenderer circle line width

Is there any way to increase the width of the line that makes up the shaperenderers circle? shape.begin(ShapeRenderer.ShapeType.Line); shape.setProjectionMatrix(batch.getProjectionMatrix()); shape.setColor(1, 0.53f, 0.53f,…
Green_qaue
  • 1,893
  • 4
  • 24
  • 55
7
votes
4 answers

libgdx game not disposing

My game does not exit entirely even after calling dispose() method. It loads a black screen when I launch it for the second time and works well if I kill the game manually and restart it. I get an error that says buffer not allocated with…
Yesh
  • 173
  • 1
  • 5
5
votes
2 answers

Libgdx ShapeRenderer rectangles

I'm trying to draw a filled rectangle in Libgdx and according to the API this should work: shapeRenderer.begin(ShapeRenderer.ShapeType.FilledRectangle); But it gives me an error and tells me to change FilledRectangle to Filled, Pointor Line.…
Green_qaue
  • 1,893
  • 4
  • 24
  • 55
5
votes
2 answers

ShapeRenderer efficiency on games

I want to draw a rectangle box to use as a text background for a visual novel library I'm writing, I wanted some flexibility of color and transparency and the ShapeRenderer class seems to fit the need but the doc brings this disclaimer: This class…
petervaz
  • 1,031
  • 3
  • 13
  • 31
5
votes
4 answers

Confused about using libGDX dispose()

Can anyone please help me to understand the proper use of the dispose(). Does dispose() get called automatically or do I have to make a call to it? In a game I'm writing, I use a texture atlas and an asset manager for all of the textures I use. I…
ace106
  • 61
  • 1
  • 5
5
votes
1 answer

Making a border around a translucent shape in LibGdx

The recommended method for making a border around a shape using LibGdx is to draw a larger version of the shape to serve as the border, then draw the shape over the larger image. shapeRenderer.setColor(borderColor); shapeRenderer.circle(x, y, radius…
you786
  • 645
  • 5
  • 20
4
votes
0 answers

Drag And Drop in libGDX (Target and Source)

I'm trying to put together a drag and drop system in libGDX with the help of DragAndDrop class. I have the typical system in which you can drag something into a box. So far it is working all dough I don't know if I am doing it in the most optimal…
yafrack
  • 163
  • 5
4
votes
2 answers

Using libraries in libgdx

This is the first time I'm using libgdx and I've got one problem. I am confused by the web of dependencies and the number of projects and I'm not sure how and mostly where to add a third party library I want to use. It should work both for desktop…
user40079
  • 284
  • 1
  • 4
  • 11
4
votes
1 answer

LibGDX Z index for groups

Have three groups, A, B and C. Let B and C be children of A. Now set B.setZIndex(3) C.setZIndex(2) Why is C drawn over B, if B has a greater Z index? If you do this: C.setZIndex(2) B.setZIndex(3) It works. However, I want to set B's index before I…
Saturn
  • 1,771
  • 11
  • 39
  • 65
1
2 3
13 14