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.

learn more… | top users | synonyms

0
votes
0answers
9 views

Libgdx: resizing images correctly

The numbers are taken using photoshop. I have a 32*32 pixel image I am using viewport = new StretchViewport(800, 400, camera); Camera x and y are also 800. I can't change the viewport. The ...
0
votes
0answers
18 views

Libgdx: How to setZIndex for pause dialog?

Pause dialog has to appear on top of the play screen, it has to appear on top of other objects. I have tried to use dialog.setZIndex(10); // or whatever number and I tried adding it in many places ...
0
votes
0answers
8 views

LibGDX Switching to fullscreen makes sprites blurry

I'm using LibGDX to develop/render my game and when I start the game in windowed mode, then switch to full screen, the sprites look blurry. Importantly(?), starting the game in full screen then ...
0
votes
2answers
41 views

Float inaccuracy. libgdx only? java only? also why?

Hey all I have just come to notice that floats are not accurate even when they are explicitly set and unchanged. For example i have some basic code running and it is: if (bike.getY() < ...
0
votes
0answers
9 views

LibGDX orthogonal Tiledmap z-sorting for bigger tiles

I use a comparator to sort all tiles by their y-values so it's rendered correctly. Npcs behind tiles are rendered earlier. But how do I do this with bigger tiles for example a 1x2 wall? The bottom ...
1
vote
1answer
17 views

How does mass work in Box2D

I'm making a 2D platformer, shooter type game in LibGDX, and I'm wondering about Box2D's mass system. I'ven't used mass for anything in the game so far, and everything has worked ok. We move the ...
1
vote
0answers
32 views

Draw copy of the game within the game

I'm making a game in LibGDX wich the main focus is "recursiveness", so i can play multiple instances of the game in itself, flowing through "layers" of games. Currently its mechanics work perfectly, ...
0
votes
0answers
17 views

Libgdx changing world

I am wondering what the best way is to handle changing box2d worlds when a new tile map is loaded. In my tilemap i have collision objects that I add to a world when I load them up. When I change the ...
1
vote
1answer
19 views

Difference between Gdx.graphics.getWidth() and camera.viewportWidth

I am a newbie in game development and I am developing an android game using Libgdx on intelliJ IDE. I want to understand the difference between Gdx.graphics.getWidth() and camera.viewportWidth . As I ...
1
vote
0answers
23 views

Trouble rendering shadowmap for planets

Im currently trying to create a game where you visit planets in LibGDX for Java. To do this I use a TiledMap which is basically just an array of tiles to represent the planets themselves. To get the ...
0
votes
1answer
18 views

Libgdx Scene2D second screen animating and accept input while still loading

I'm currently developing an app Scene2D that involves a small number of screen switches. I am having a problem that after calling set screen there appears to be a pause of a second or two (I think it'...
1
vote
1answer
39 views

Creating straight lines between two Vectors? (and slopes?) (interpolation??) libgdx java

I am trying to make a game with very basic physics (just gravity at this stage). Without using box2d How is the best way to create the solid ground. I will be wanting to make ramps soon, but at this ...
1
vote
0answers
17 views

Handling multiple touches libgdx GestureListener

I've been trying to create a game with two finger gameplay (ie. If your finger is in the bottom 20% of the screen it will move the player along X axis towards your finger, and if you press finger ...
0
votes
0answers
10 views

LibGdx: Pad the text inside an ImageTextButton

How can I pad (move around) text inside an ImageTextButton? Getting the cell of the label seems to not do anything. ImageTextButton btn= new ImageTextButton("some text", btnStyle); btn.getLabelCell()....
0
votes
0answers
20 views

Road Rash / Outrun style scrolling background (2d) (Libgdx)

any ideas where i should start looking (good tutorials, or even the right keywords for searching info for this) to find help with greating a 2d scrolling racer road such as Road Rash or Chase HQ? I'm ...
0
votes
1answer
38 views

Ways of implementing loading sequences

I'm looking for ways of implementing loading sequences which consist of other actions besides fetching resources from filesystem, such as generating entities, levels and such. So far I've built a ...
0
votes
1answer
15 views

Creating trading card board layout in libgdx

I wanna make a trading card game using libgdx. I have a general idea about how to implement the server side of the game and the game rules, but I don't know how to design the visual interface of the ...
0
votes
0answers
23 views

LibGDX - Are TextureRegions a “required” way to handle animation?

I'm working on a small game to try different ways of rendering sprites and practice inheriting/extending classes. Right now I'm working on a AnimatedSprite.cs class which all Entities should extend. ...
0
votes
0answers
22 views

LibGdx Scene2d: Completely remove Actor from Table

I have a Table called container, inside this container I add a Table called animTable. After the animations in animTable are finished I try the following: actor.addAction(Actions.sequence(Actions....
1
vote
1answer
42 views

Moving sprite using the accelerometer in LibGDX?

I don't know how to use accelerometer in LibGDX; how could I use the the motion sensor? I'm working for a top down game with the motion sensor. I'm new to this framework. My sprite image is already ...
0
votes
0answers
30 views

LibGDX - Turning TiledMapTiles into objects

I'm working on a harvest moon type game and I've already created lots of assets and have a working player. Now the issue is with the tile map. I use Tiled Map Editor to make the map and it renders ...
1
vote
1answer
36 views

How to load background image in sprite class in libgdx?

How can I insert a background image in sprite class? here is my code..Thank's and advance import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics....
1
vote
2answers
43 views

How to change FPS during runtime in LibGDX?

I would like to be able to change the desired fps (foregroundFPS) during runtime without having to restart the game. I know how to set it before launch with LwjglApplicationConfiguration but I have no ...
0
votes
0answers
15 views

Pixmap packer null pointer exceprion

While using the PixmapPacker for creating texture atlas at runtime like the following PixmapPacker packer = new PixmapPacker(512, 512, Format.RGB565, 2, true); packer.pack("First Pixmap", pixmap1); ...
0
votes
0answers
40 views

Libgdx: (JSON) deserialization of a generic object within an ArrayList thats in an ArrayList

I read this thread, but I don't understand what's going on. Why am I not able to import an Arraylist of a generic type, and need to deserialize it? Shouldn't this work regardless? This is the ...
0
votes
1answer
67 views

Libgdx: Aligning buttons inside dialog

I have the following dialog, semi circle shape. I want to position buttons in it. dialog.button(closeButton, false); dialog.getContentTable().add(buttonS); dialog....
0
votes
1answer
20 views

SOLVED difficulty with final admob configuration/implementation libgdx

I've been trying to include some ads in my app using AdMob. It all launches ok so i assume i have the library added correctly etc. I followed a tutorial that was over a year old (Brent Aureli on ...
0
votes
0answers
6 views

When changing Google Play version in gradle to most recent version it doesnt work (libgdx)

I have GPGS installed ok in my apps and I was using version 10.0.1, I notice from this page https://developers.google.com/android/guides/releases that the latest version is 10.2 When i change it in ...
0
votes
2answers
40 views

Libgdx: How to draw the score on the top left?

I want to keep the score visible on the top left corner of the screen. I have the score talking care of. I just want to display it. Score: x The comment on the accepted answer on Stackoverflow ...
0
votes
1answer
31 views

LibGDX player movement on X axis is very limited

I'm making a side-scroller game using LibGDX, where player can move only on X axis. The problem is that the player can only move on positive X value, so he can't go to negative X. This is not that big ...
0
votes
1answer
54 views

Game crashes when two objects of same class collide libgdx

I have a class named Meteor and I created a function that create Meteors all the time, and I have a Player class. The collision between the Player and Meteor works fine, but the game crashes when a ...
0
votes
0answers
39 views

Libgdx: Candy crush style bouncing button animation

This article describes how to make candy crush style bouncing button animation using SVG <?xml version="1.0" encoding="utf-8" standalone="no"?> <svg width="100%" height="...
-2
votes
0answers
30 views

What types of controllers are there in LibGDX?

I would like someone to give me a list of all of the types of usable controllers in the LibGDX controller extension for Java.
0
votes
1answer
40 views

How to change the position of a dialog?

I have created a dialog in Libgdx main menu screen. I have tried dialog.setPosition(300, 300); dialog.show(stage); It doesn't do anything. Is it a camera trick? Am I missing something?
1
vote
1answer
37 views

Libgdx: How to rotate a button on main menu

How to keep rotating a button on main menu screen around its center, here's the code for the button final ImageButton btnSett=UIFactory.createButton(txtrSettings); btnSett.setScale(1,1); btnSett....
1
vote
0answers
20 views

Can I use JBox2D on server with Box2D on libGDX on client?

I want to use Box2D for my turn-based game, made with libGDX. The client is supposed to do some prediction of physics after his input and I want to correct these calculations with server-side ...
0
votes
1answer
37 views

Restricting object going out of screen while resizing-LibGdx

I have an object that I am resizing from bottom to top. private void setStickSize() { if (MyInputProcessor.isTap) { stickSprite.setSize(stickSprite.getWidth(),stickSprite.getHeight()+500....
0
votes
2answers
64 views

Need help with getting a direction vector between two given points

I need to find the angle of rotation from a bullet traveling from point A to point B, like in my attached diagram. I tried searching, but I got a little lost in which exact formula to use. I want to ...
0
votes
0answers
15 views

Can not play 2 Music instances on Android LibGDX

I am making a game in LibGDX and I need to play 2 melodies at the same time. However on Android loading and playing 2 melodies does not work. Here is a small test I did. I even tried using the LibGDX ...
0
votes
2answers
33 views

Libgdx: how to pick a random texture?

I'm trying to pick a random texture from a fodler placed in assets and use it but it's giving me errors. I'm doing so in the main game screen class final File dir = new File("img"); Random ...
0
votes
1answer
21 views

spriteBatch.draw is not getting overloaded

I am following this tutorial from gamefromscratch.com tutorial 11. I am using libGdx framework in Android studio . public class OrthogonalTiledMapRendererWithSprites extends ...
0
votes
0answers
15 views

LibGDX Scene2D and updating labels inside a table

I have a (Scene2d) Table containing a Label, both added to a Stage, and I'm properly calling stage.act(float) and stage.draw(). However, if I modify the text of the Label (using setText()) to be wider ...
0
votes
0answers
48 views

Does a server-sided physics calculation kill server performance?

I want to implement a 2-player turn-based game with libgdx, networking is done with kryonet. I already set up a server that listens for new connection and matches every two new connections, creating a ...
0
votes
1answer
34 views

How to convert or import files from Illustrator in Tiled for game development?

I have created all my images for a game in Illustrator, now I want to convert them in Tiled Sheets for developing my game in libGDX. So could I import or convert these .ai files from Illustrator in ...
0
votes
1answer
43 views

Drawing a partial sprite with batch-LibGdx

I have a sprite like this. I want to draw this sprite in such a way that sprite is growing from bottom to top, using sprite batch on tap.for that,I have written the following code: if (...
-1
votes
0answers
47 views

Integrating Google API client with Libgdx

The Google API guides are some of the worst most confusing reads I've ever worked through. I have a few nice working games for Android and I bought the Developers account for the Play Store, but there ...
-1
votes
2answers
74 views

How big is a Game World in LibGDX?

I know that the game world is like the whole game itself and most of the time, the developer sets the Screen to be a particular section of the Game World. However, how big is the Game World? For ...
0
votes
0answers
23 views

Does the Physics Body Editor from Aurelien Ribon work with a Texture Atlas?

Is it possible to use the Physics Body Editor from Aurelien for a texture atlas? I have only been using it with seperate textures. If so, can someone please give an example in code? This is my ...
0
votes
1answer
39 views

How is the render() method called in LibGDX?

Ok, I know that the project generator in LibGDX finds the render(deltatime) method in my Game project and make it into a game loop so that it repeats itself on an average of 60 fps. But I want to know ...
0
votes
1answer
65 views

How to move an object from off screen right to left continuously?

I am trying to make an object move from off screen on the right to off screen left and continuously generate (like the flappy bird pipes). How would I do this with my current code below? I have tried ...