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
13
votes
1 answer

Simulating palette swaps with OpenGL Shaders (in LibGDX)

I'm trying to use LibGDX to make a retro-style little game, and I'd like to let the players to choose the colors of several characters, so I thought about loading png indexed images and then updating palettes programatically... How wrong I was ^^U…
hcito
  • 153
  • 1
  • 5
13
votes
2 answers

Application loading the wrong textures on opening again

I'm developing a game using libgdx library. When I load the program for the first time, the textures load perfectly and everything is fine When I close the application, and load it again (I'm assuming Android is somehow caching it from memory) -…
Haedrian
  • 4,240
  • 2
  • 32
  • 53
13
votes
3 answers

Libgdx weird modelling - depth error?

I'm getting this when I load any .obj file with ObjLoader: How it looks like in real: How I'm loading it: ModelInstance instance = new ModelInstance(model); instance.transform.setToTranslation(-4, 0,…
lacas
  • 13,928
  • 30
  • 109
  • 183
13
votes
6 answers

How to remove gaps between tiled textures?

I'm using LibGDX to make a platformer. I'm using square tiles for the platforms but when they are drawn some of them have gaps between them. When I zoom in/out or move the camera around the gaps move position. More details: Tiles are 32x32 and I…
user2291015
  • 131
  • 1
  • 4
13
votes
6 answers

How to draw a BitmapFont in LibGDX?

I'm seriously betting that I did something effing stupid and just can't seem to notice it. package com.me.mygdxgame; import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL10; import…
ains
  • 1,436
  • 4
  • 18
  • 33
13
votes
1 answer

Cannot get events working in my libgdx Actor

I'm having a hard time getting events working with my Actor in libgdx. I'm using nightly builds. My stage is setup in the show() method of a Screen subclass: stage = new Stage(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(),…
Micah Carrick
  • 9,967
  • 3
  • 31
  • 43
13
votes
7 answers

Keep libgdx camera inside boundaries when panning and zooming

I am developing a game for Android using LibGDX. I have added pinch zoom and pan. My issue is how to keep from going outside of the play area. As it is, you can pan outside of the play area into blackness. When zoomed out fully I know how to deal…
weaverx9x9
  • 495
  • 6
  • 17
12
votes
4 answers

Scrolling parallax background, infinitely repeated in libgdx

I'm making a 2D sidescrolling space shooter-type game, where I need a background that can be scrolled infintely (it is tiled or wrapped repeatedly). I'd also like to implement parallax scrolling, so perhaps have one lowest background nebula texture…
fundead
  • 1,321
  • 1
  • 14
  • 15
12
votes
3 answers

difference between Viewport and camera in Libgdx?

I am new to LibGdx framework and having trouble working with viewport and camera. Can anyone give a simple difference between each and use of both?
Rajesh Mainali
  • 149
  • 2
  • 5
12
votes
1 answer

Draw a smooth line

I am developing a game using libgdx and i want to draw a smooth line using shape renderer. shaperenderer.begin(ShapeType.Line); shaperenderer.line(fisrstVec2,secondVec2); shaperenderer.end(); I have tried Multi Sample anti…
12
votes
2 answers

Exporting A Libgdx Game as Executable Jar from Android Studio

Okay so I made a game using Libgdx and I intended it to be a android app(which is why i use android studio) but I want to let my friend without android phones try it out. The project is already setup for both desktop and android so is there any way…
user1804234
  • 331
  • 1
  • 3
  • 13
12
votes
3 answers

How to create skin for libgdx project?

I looked at the default skin files from the test project. I don't understand why uiskin.png has a font images inside it. also the uiskin.atlas file contains split field that I don't understand why do I need it and how to use it. Where can I find a…
Alex K
  • 5,092
  • 15
  • 50
  • 77
12
votes
3 answers

libgdx - how to add background image in stage?

I am learning libgdx but i am stuck at a point.. I have added a button in my stage , now i want to add a image in the stage so that the image looks as the background image to the button.i mean to say that the button should lie on the image. I have…
rahul_raj
  • 275
  • 2
  • 3
  • 9
12
votes
1 answer

How can I change the texture in a Scene2D Image using libGDX?

How can I change the texture in a Scene2D Image? http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/scenes/scene2d/ui/Image.html There is no such method in the docs. I create mine by providing its constructor a texture reference.
Saturn
  • 17,888
  • 49
  • 145
  • 271
12
votes
2 answers

libGDX project can't load library liblwjgl.dylib

A new libGDX project can't load the library liblwjgl.dylib when running the desktop project. Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library:…
Appleshell
  • 7,088
  • 6
  • 47
  • 96