2022 Developer Survey is open! Take survey.

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.

Filter by
Sorted by
Tagged with
1 vote
2 answers
20 views

Libgdx World point to screen point

It seems like converting a screen point to a world point is easy in libgdx but going from the world point to a screen point is quite tricky. So How do I convert a world point into a screen point?
user avatar
-1 votes
1 answer
47 views

Draw more sprite but they disappear

I have a array of sprite in a class "Enemy", I want to draw enemies in some positions, but when I draw one, the previous one disappears. ...
user avatar
0 votes
1 answer
55 views

Drawn enemy random on different position

I would like to insert random enemies in the map in different positions. It's possible? This is how i load image of enemy: Enemy.java: ...
user avatar
1 vote
1 answer
39 views

reposition object in circle

As you can see on the image, I have a p1 and p2 objects with (x,y) coordinates which I know the values, and I know radius of all these circle objects. However, I want to calculate new position x,y ...
user avatar
  • 115
1 vote
1 answer
17 views

Fade in with stage libgdx doesn't work

i use a stage on my background but the fadein doens't work. This is my code: ...
user avatar
1 vote
1 answer
36 views

Create a transition fade out in libgdx

How can i create a fade out in libgdx? I have a class "Menu" and with a fade, i want to change class to "Game". This is how i change class, from "Menu" to "Game"...
user avatar
3 votes
1 answer
752 views

LibGDX - My sprite glitches when it moves

My player sprite glitches when it moves across the screen. I've tried multiplying movements by delta time. I've tried rounding. It seems to do this completely at random. Sometimes I can move it all ...
user avatar
0 votes
0 answers
33 views

Can I use libgdx to create a game that runs on multiple devices?

I created my first game using Libgdx and Android Studio. The game runs smoothly on my Android phone. If you want to run it on an Apple phone with IOS or a computer with Linux etc. how could I do? I ...
user avatar
0 votes
1 answer
9 views

Error using Asset Manager for loading files from Android temp directory (libgdx)

I'm creating a game for Android using libgdx and Google Firebase for storage. In my Loading screen I download a file from Google Firebase Storage and store it in a temp file. After the dowload ends ...
user avatar
0 votes
0 answers
26 views

How to not resize but move widgets when screen resized?

I have added buttons to my code, but when I go to "resize", they get bigger or wider and it looks very bad. How can I resize the window and keep the button aspect ratio? This is my code: 1)...
user avatar
0 votes
1 answer
17 views

Orthographic camera in libgdx does not work with constructor when passing viewports size

I am playing around with LibGdx and its OrthographicCamera and notice something, what is really strange for me. I mean if you look into the code below you will see that I am initialising ...
user avatar
  • 103
0 votes
0 answers
26 views

Box2D Body cannot be serialized. How to ignore or serialize it successfully?

In my game, which implements the network functionality with Kryonet, I would like to send a class ("MyBox2DComponent") over the network which e.g. contains a field of type Body (Box2D). Of ...
user avatar
0 votes
0 answers
14 views

How to implement a generic modular render pipeline?

In my project (based on libGDX) I use an ECS system (Ashley). Each graphical entity has a SpriteComponent that is a TextureRegion. There is a rendering system that iterates over all SpriteComponents, ...
user avatar
0 votes
0 answers
22 views

HashMaps with String keys as animation keys okay?

In my project I use an ECS system. I have a SpriteComponent that contains a map of animations. ...
user avatar
0 votes
0 answers
28 views

Custom cursor not appear in screen

I am trying to create a custom cursor for my game the same way as described in de official documentation: https://libgdx.com/wiki/input/cursor-visibility-and-catching I have this in the constructor of ...
user avatar
0 votes
1 answer
47 views

Libgdx OrthogonalTiledMapRenderer doesn't render properly

I will simply leave a clip of it as it's easier than describing the problem. https://imgur.com/a/kS7sXhW This is All the code that i have ...
user avatar
  • 37
0 votes
0 answers
48 views

LibGDX sprite not moving with rotation

I have a player class and I'm trying to rotate the player and move it in the direction it's facing. The rotation works but I can't get the sprite to move. ...
user avatar
0 votes
1 answer
37 views

Is there an algorithm for a Joystick class that happens to be engine/framework independent?

I need to be able to get the given input's distance inside the joystick, bounded within -100% and 100% and an unbounded version of it, get the position of where the mouse's position projects to the ...
user avatar
  • 37
0 votes
1 answer
26 views

Vector2.Zero unexpected behaviour when used to initialize Vector2

I have base class which contains a Vector2 velocity field, which I was initializing in the constructor with Vector2.Zero. But ...
user avatar
  • 103
0 votes
0 answers
13 views

LibGDX TextButton removes numbers from string

I have been having a unique problem with the LibGDX TextButton. In some cases, when setting the text of the button, the string lacks numbers (even though they are present in the string which can be ...
user avatar
  • 1
1 vote
0 answers
26 views

Libgdx sidebar like in Tibia

I'm new to LibGDX and I'm trying to make a simple RPG game. I've implemented a basic movement & combat system. Now I would like to add a sidebar with inventory, character information etc. (like in ...
user avatar
0 votes
1 answer
61 views

Needs help on actually making the trigonometric function work as intended

...
user avatar
  • 37
0 votes
1 answer
41 views

Need help on finding the algorithm for getting the FlipX, Y and TextureRotation of my DirectionalAnimation class

I've created a class called DegreeAnimation, which is basically an implementation of my CustomAnimation class, but works with other directions, there are 2 constructors for this class, one where the ...
user avatar
  • 37
0 votes
1 answer
63 views

Libgdx pre-rendering Bitmap font to pixmap texture causes slow in-game rendering

Im using libgdx scene2d to render 2d actors. Some of these actor groups originally included scene2d Label actors for rendering static text. The Labels work fine but drawing ~20 of them on the screen ...
user avatar
0 votes
1 answer
96 views

Extracting cell center and corner points from rasterized Voronoi diagram

I currently have this code which I copied from Rosetta code: ...
user avatar
  • 37
1 vote
1 answer
50 views

ParticleEffect using TextureAtlas in libGDX

I am using ParticleEffect with a texture stored inside TextureAtlas. The code below shows how I load a particle: ...
user avatar
  • 13
1 vote
2 answers
228 views

Shooting from Gun in LibGDX

I'm trying to shoot a bullet from the tip of a gun. This gun is a Sprite object and it is constantly being rotated to point towards the mouse. The issue is that the point to shoot the bullet from is ...
user avatar
2 votes
1 answer
49 views

How to dim the device backlight using libGDX?

I have an idea for a very minimalistic game. To fit in with this theme. I want no explicit messages or tutorials etc. I want to experiment with ways to very gently, implicitly prompt the player to ...
user avatar
0 votes
1 answer
62 views

Libgdx changing animation during runtime?

I've made an animation class that creates an animation for a player. However, I'm wondering how I can change the animation depending on where the player is currently moving? Heres my animation class: <...
user avatar
0 votes
1 answer
82 views

How to interact with inventory only and not the game

I have created an inventory in which you can select some objects that you can spawn. This is a button in a table in a inventory class. Spawning is done via left mouse button (just click on some ...
user avatar
  • 101
1 vote
1 answer
47 views

How can I assign a World.createBody to a variable after initialization, `var` and `val` don't work?

...
user avatar
  • 37
0 votes
1 answer
87 views

LibGDX latest, Ubuntu 20.04, OpenJDK 11, Gradle 6.7.1 - Unsupported class file major version 60

LibGDX latest, Ubuntu 20.04, OpenJDK 11, Gradle 6.7.1 Using above systems and first got below error - ...
user avatar
2 votes
1 answer
71 views

LIBGDX ShaderProgram not passing uniforms

I'm trying to implement a Shader that turns any RGB values below 190 into black. LIBGDX code: ...
user avatar
1 vote
1 answer
191 views

Resize and move widgets when screen resized

I want to add buttons to my libgdx based game and have them be independent of the window's size, but when I resize the window, the buttons stretch and deform instead of being resized and/or moved. ...
user avatar
  • 21
1 vote
1 answer
112 views

Should delta be applied to every change per frame ? (e.g. acceleration, deceleration, jump, etc.?)

I have written a game based on another game's original physics. I have all the constants the original game used in the Sega Megadrive. For example: ...
user avatar
0 votes
0 answers
58 views

LibGDX: How to grow button height downwards in Table?

For my layout, I have a Table in which I add TextButtons with a height of 20. I also set the height of the table to 30. When I now increase the height of one button to 30, the height grows not ...
user avatar
0 votes
0 answers
24 views

Setting a TiledMapTiledLayer equal to another TiledMapTileLayer?

I am attempting to create a reset button in a simple isometric libgdx puzzle game I am making utilizing libgdx. I am using the TiledMap object in order to render my map. Within my code, I edit some ...
user avatar
  • 1
0 votes
0 answers
73 views

Focus problem when switching to fullscreen mode in libgdx

When I run my app in fullscreen mode on a desktop, it starts to behave strangely. The window is created but its content is not shown. I can switch between other open windows using ...
user avatar
  • 101
-1 votes
1 answer
154 views

How to enable anti-aliasing when camera zoom in libgdx

I develop a game where I draw some textures on the screen and want to zoom in and out the scene. I am using OrthographicCamera and when I zoom in, the textures ...
user avatar
  • 101
1 vote
0 answers
21 views

Libgdx tiles get overlapped on render

I'm trying to create a Tilemap with 64x64 textures which follows this configuration. ...
user avatar
0 votes
0 answers
62 views

LibGDX getting model roll

I'm working on a 3d game in LibGDX, got help on here with my model rotation. Worked great. But now I'm dealing with the model's roll, and it's not behaving as expected. It's controlled by: ...
user avatar
0 votes
1 answer
110 views

LibGDX setToRotation canceling out position

I'm working on a 3d project in Libgdx. I've got a camera flying around in 3d space, being controlled with touch. Works great, moves forward and backward, strafes, full 360 look around with no gimbal ...
user avatar
0 votes
1 answer
58 views

LibGDX - Actors added to a stage from a network thread are not drawn

I have an application with several Screen and Actor. On my main screen, the actors added to the stage during creation are ...
user avatar
1 vote
0 answers
532 views

OpenGL Compute Shader vs Fragment Shader device support

I have a game with massively parallelizable logic, which I intend to write calculate on the GPU (Java/LibGDX). I am planning to implement a logic for it through a fragment shader, instead of a compute ...
user avatar
0 votes
1 answer
42 views

LibGDX - Rendering problem when in a Timer.Task

I have a "console" window in-game where I log messages. When starting up, the game checks for updates by way of a Timer.Task. Any messages I try to log in ...
user avatar
0 votes
1 answer
63 views

How to make the automatic movement of an actor and control that it does not go off the screen?

I have an actor in a class who then I put him in the main scene, but I want the actor to move randomly, that is, now he moves to the right, then down ... but controlling that he does not leave the ...
user avatar
0 votes
0 answers
84 views

LibGDX - Render texture background twisted

I am developing a 2D survival game. In these days, without make some features, I am fixing some bug. There is one which I got stuck on: my map has a background made with grass, earth, desert, water ...
user avatar
  • 15
-1 votes
1 answer
63 views

Google Play Game Services Detecting Top 3 Players

I used Google Play Services Leaderboard in my Libgdx game. This is what I want to do; I would like to give awards to the best 3 players in this table. How can I help you? It automatically connects to ...
user avatar
1 vote
1 answer
93 views

LibGDX Bounding system with tiledMap, 3D model player and ortho cam

Begins explaining my achieve: as I said in my last question, I am tryna makin' a 2D game with 3D player as Factorium. For hours I am tryna to make a kinda of bounding system: 1)Camera will follow ...
user avatar
  • 15
0 votes
1 answer
308 views

LibGDX make player rotate towards mouse pointer (Player facing mouse)

I am tryna makin' a 2D game with a 3D player (kinda of Factorium). I got stuck on the rotating of the player. I'd like it look always torwards to the mouse. e.g. If I move mouse on the top-left of the ...
user avatar
  • 15

1
2 3 4 5
46