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

LibGDX resize window - Scaling font

I am writting simple "Hello World"-style program , that writes current nameday on screen. I want to ensure , that text would be readable and correct drawn also after resizing the window. In my create method, I tried to use this code (according this…
3
votes
1 answer

How to get collision detection of a rotating object in libgdx

I have a game object which is going to rotate. import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; public class Object extends AbstractGameObject{// AbstractGameObject…
3
votes
3 answers

GameStateManager LibGDX

I started a project with libgdx and I have a GameStateManager for my GameStates Menu and Play. If I run the project it shows the Menu and then I can click a button to open the Play GameState. The Problem is, that when I ended the Game it should show…
3
votes
2 answers

LibGDX iOS RoboVM Landscape Orientation not fullscreen

FIXED IN LIBGDX 1.4.1 Thank you BadLogic, you guys rock! The project was generated using the gdx-setup.jar file in stable build Version 1.3.1 for testing purposes. (I show later how I update LibGDX to latest snapshot) Here is a screenshot of the…
user3386826
  • 327
  • 8
  • 19
3
votes
1 answer

LibGDX 3D collision detection

I am using LibGDX game engine to create 2d games and box2d for physics. How can I check for collisions? Is there sth like box2d for 3d games?
Vahe Muradyan
  • 1,115
  • 1
  • 11
  • 22
3
votes
1 answer

Saving and loading files in HTML5 with LibGDX

I was looking at the "wiki" for LibGDX and I don't see a method to save or load when using HTML5. Could anyone point me in the right direction on how I can go about saving and loading files in HTML5 via LibGDX? I know it is possible with HTML5 just…
user3534018
3
votes
0 answers

Wrong coordinates for different objects

In short: I create Polygon object with a help of this method: public static float[][] getPolygonArrays(float cx, float cy, float R, int sides) { float[] x = new float[sides]; float[] y = new float[sides]; double thetaInc =…
eliotik
  • 171
  • 1
  • 10
3
votes
1 answer

libgdx: Parse.com iOS SDK and RoboVM

I have a app project using libgdx 1.2. I want to add Parse.com push notifications to its iOS and Android builds. No problems with the usual java interface that enables the core app to call into the native platform methods, but I have quite a few…
Lucio Crusca
  • 1,277
  • 3
  • 15
  • 41
3
votes
1 answer

In game Images disappear on Android device if i run from widget, but not when I install apk first time

I created a game in with LibGDX, which works fine on my computer. I created a debug .apk in Android Studio via the Gradle View -> Build & then copied my android-debug.apk & android-debug-unaligned.apk to the download folder of my Android Device. Now…
Rik van Velzen
  • 1,977
  • 1
  • 19
  • 37
3
votes
1 answer

Different Box2D body speeds on different devices

My problem is documented in this: Video Background speed and animations are running at the same speed while items, who are thrown by that black guy, move slower on the white device... Well yeah, white phone is older, but that is not the problem, i…
3
votes
1 answer

Libgdx - how to have screens rotated within a single viewport?

I've built an game in Libgdx which uses a single FitViewport passed-in to some Screens (Splash/Intro/Game/Menu/Pause etc.). Each Screen has it's own Stage containing Groups of Actors - I've written a custom render loop to allow Screens to…
user834595
3
votes
1 answer

Font for different resolution Libgdx

I have a problem with fonts: I have a bitmapFont and I use it for write words in Label, my problem is that when change the resolution of screen the font seems pixellated. Looking at network I discovered that this problem can be resolved using…
3
votes
1 answer

Dialog's object position Libgdx

I have a Dialog : Dialog dialog=new Dialog("",style); dialog.setSize(400, 500); dialog.setPosition(Gdx.graphics.getWidth()/2-200, Gdx.graphics.getHeight()/2-300); I added a two button in it: dialog.button(stopButton); dialog.button(goButton); My…
3
votes
1 answer

libGDX InputProcessor not functioning correctly when multiple keys are pressed

I have a class InputHandler which implements the libGDX InputProcessor. It is used to handle arrow key and space bar events. The keyDown and keyUp methods: @Override public boolean keyDown(int keycode) { switch (keycode) { case…
AkraticCritic
  • 2,595
  • 2
  • 12
  • 11
3
votes
1 answer

Libgdx sprite rotation causing position offset

Hi I am creating a game for android using the Libgdx framework. I am trying to place a sprite in the middle of the X axis near the top of my screen. I can do this just fine but since the sprite needs to be rotated 90 degrees(to save room on…
user2002077
  • 595
  • 1
  • 6
  • 17