Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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.

0
votes
1answer
9 views

Do I need to dispose Pixmap in Actor?

I create Pixmap in Actor and don't know how to dispose it. Is it necessary in my case? ...
0
votes
0answers
18 views

Queued rendering in LibGDX 2D

In my 2D game project, as well as in LibGDX in general, are a lot of different entities that need to be rendered(static images, sprites, animations, etc...), as well as have certain effects applied (...
-1
votes
2answers
30 views

How to get color from texture at specific location in libgdx?

This is the screenshot of my game. This is a 2d platformer game where the player jumps to many differently colored tiles. On the left-hand top corner, there is a square tile which changes its color ...
0
votes
1answer
22 views

Player customization of entity and handling textures

I'm developing a racing game where you can customize your vehicle with pre-made textures and also user generated ones (players can add assets to the game). I want to know what you think is the best ...
1
vote
2answers
32 views

How can I draw Polyline and detect its collision with other objects?

The idea is to draw trace of moving Actor and if some other Actor intersect it, some function would be called. I've been searching for solution to this problem in Intersector class, but it seems to ...
0
votes
1answer
51 views

How can i collide two bodies without filtering(collision filtering)?

I have two bodies with fixtures. One is platform or ground and other is the player itself.I want to collide the player to the platform without bit filtering.How can i do that?I can see the rectangular ...
0
votes
0answers
12 views

Drag and drop more than one sprite (image) on Libgdx

well i am trying to achieve the same effect of windows desktop , you can select multiple icons and drag all of them to differents positions. here you can see how i select the images in the second ...
0
votes
0answers
35 views

improving a real-time tile based 2d lighting system

I'm making a 2D game with lots of little particles that can fly all around the screen. The viewport has a resolution of 900x900px. Within that region, at most 450x450 particles can be displayed per ...
0
votes
1answer
33 views

LibGDX Stage and Viewport management for Actors?

So I've done research about how to use Stage, Actor and Viewports etc. To optimize the game for most devices running Android. I'm pretty sure that the viewport is configured or the background image is ...
0
votes
0answers
22 views

Using 3D models in an 2D Game in libGDX

In my libGDX 2D RPG-Game (like Zelda or something) I want to display some items as 3D-Objects. Since I'm using an OrthographicCamera like this: ...
0
votes
0answers
21 views

Easy sprite-based 2D game in LWJGL3?

Earlier we have used libGDX, and in it, creating a sprite object was really simple, like: ...
0
votes
1answer
24 views

Does destroying body also destroys the sprite?

Suppose a sprite is attached to a box2d body. And world.destroyBody(b); is getting called then the sprite also get destroyed or it stays there in memory. In my ...
0
votes
0answers
12 views

How to force LibGDX to screen resolution on Android?

No matter what type of viewport I use, the Android version of my code renders to exact resolution on the bottom left of the screen. How do I make it occupy the whole screen realestate? I've tried ...
1
vote
1answer
25 views

How to set a box2d body to follow a strict path

I'm making an infinite runner type game and I want one of my enemies (when it's created) to swoop down in a sort of U motion where it'll hit the player if they don't react quick enough once the enemy (...
1
vote
0answers
21 views

Loading animation from server?

As android app that will be playing animation online, it will be connected via web-socket to a server. The question is, what is the recommend way to store animation that will be loaded by the android ...
1
vote
0answers
28 views

How can I render two scenes simultaneously on LibGDX?

In my LibGDX game, I'm trying to render two 'views' (one next to the other) at the same time. The idea is to have each view rendered according to global coordinates, but everything inside would be ...
0
votes
1answer
50 views

How to remove horizontal black bar at the bottom of the game screen in libgdx?

Here is the screenshot .Here is my Play constructor in Play class.
0
votes
1answer
28 views

libGDX 3D texture is stretched

I'm working on a 3D maze game using libGDX. I'm using MeshBuilder to render the walls. All walls are a single part made using a ModelBuilder in the create(): ...
0
votes
0answers
21 views

Why is the player is coming out of the Box in libgdx?

I'm having a very strange problem. When I start the game, and while using the debug camera, all of the outlines are offset to the tiles (player, diamonds, ground) about 32 pixels to the left. As I ...
0
votes
1answer
21 views

Why is the Tilemap not fitting the screen?

I have a background image which I made it in tiled map editor of width 40tiles and height of 8tiles.When I run the game the tilemap bounces with the player and I can see the black portion of the ...
3
votes
2answers
59 views

How to make the camera follow the player in Libgdx?

In Play class I have the viewport of game height=320 and game width=240unitswith camera cam. I have set the camera(cam) viewport width to 10 and viewport height to 7.I have another camera hud whose ...
0
votes
1answer
30 views

How can I fill a Polygon with a certain color on Pixmap?

Libgdx allows to fill area on a Pixmap just with circles, rectangles and triangles, but I need to fill complex figure that can be described with Polygon class, so how can I do that? I was thinking ...
3
votes
1answer
31 views

Java/LibGDX Self made Input Field

I want to create an Inputfield from Scratch in Java and LibGDX, my Question is: How can I display only certain Parts of a String in a specific width? For example: My Input field GUI is 200 pixels ...
1
vote
0answers
35 views

How to add AdMob to Libgdx in 2018?

I found this article here: https://github.com/libgdx/libgdx/wiki/Admob-in-libgdx But it's from September 2017, and since then Android and Android Studio have been updated. How can I add AdMob to my ...
0
votes
0answers
19 views

Define GLSL shader version in LibGdx

I'm using libgdx 1.7.1 and I need a higher version for a shader, but when I define a version using #version I get this error: ...
1
vote
1answer
35 views

Dragging arrow around using touch point Bubble Shooter libGDX?

So, now I've got into my second problem of implementing the arrow. The rotation works fine from this link but I have to calculate the angle from a touch point to the middle of the arrow placement. I'...
1
vote
1answer
24 views

Implement Bubble Shooter arrow rotation using LibGDX?

I'm trying to implement an arrow at the bottom of the screen on an Android device. This arrow is placed in the center of the screen and is supposed to rotate by a given angle. The problem is that when ...
0
votes
1answer
19 views

Libgdx Tiled | Using setTile results in a NullPointerException

So, I'm attempting to change the texture of a block when the player comes in contact with it by using cell.setTile(tileSet.getTile(926). I've already looked at ...
0
votes
1answer
43 views

Tuning physics for a “worms”-like game

I'm using LibGDX and Box2D for my physics but my characters bounce all over the place when moving and if there is a small slope in the terrain they launch off of it. I've tried tweaking settings but ...
1
vote
1answer
11 views

LibGDX Json writes only part of class

Hello I've been developing this game for awhile and now trying to implement save data via Json. I've gotten to where when the app is first launched it will write the Json file with the variables I ...
1
vote
1answer
24 views

How to insert animation into table?

I'm having trouble inserting animation into my libGDX table cell. I have a class which holds 2 tables, one on the left and one on the right. First table is for labels/buttons/other stuff. Second table ...
0
votes
1answer
48 views

Reducing texture bindings in LibGDX when drawing text

I'm making custom menus and buttons (I don't want to use scene2D) and I have everything in atlases, but when I draw a button, if it has text, the texture binding is always x2 because of the switching ...
0
votes
1answer
28 views

Remove background from sprite sheet after splitting

I am using libgdx to implement a Parallax background. Now I need to show some animated object over the background. I downloaded a sprite sheet(with images of objects on white background), and split it ...
0
votes
1answer
22 views

Focus scene2d UI actors programmatically in libGDX

I am trying to implement keyboard movement in game main menu which is libGDX Stage with UI-Actors. I'm also trying to code this feature myself since I can't neither ...
0
votes
2answers
235 views

Why does my Window take a few clicks to actually close even though the event fires?

I am pretty new to game dev (and libgdx + scene2d specifically), I am creating a dialog system for an rpg game and obviously a dialog window has a close button to close a dialog but for some reason it ...
1
vote
1answer
36 views

Why are clicks not corresponding correctly to XY positions?

I'm trying to make custom buttons in LibGDX (I really only wanted to use it for the Android/Desktop portability, not for any of its features, like Scene2D) The issue I'm having is that the clickable ...
0
votes
0answers
32 views

Oblique projection math incorrect? [Partly solved]

+++Update+++ Partly solved it. The isometric projection of the area sprite image and the grid wasn't true isometric (30°), because I already calculated it in 2:1 ratio, what gives an angle of 26.656°...
0
votes
0answers
30 views

Libgdx i18nbundle work only root bundle

English isn't my first language. In mobile i18nbundle get only root bundle (BlueStacks similarly). Code : ...
0
votes
1answer
50 views

libgdx ashley how to detect clickEvent on Entity

How can I detect a click event on an Entity? I use libgdx with Ashley. Must I implement it by my self e.g. in touch down method of InputProcessor test if any entity is on this click position. Or exist ...
0
votes
1answer
27 views

For loop only checking the last object

Hi I am using a for loop to check and see if my players character is colliding with a collision object in the game. But for some reason it only checks the last Rectangle of the list. ...
0
votes
0answers
8 views

Progressive lag with each collision iteration libGDX AIDE

Hello I am developing a game on my spare time with AIDE and libGDX. Though AIDE has some missing methods of the libGDX API and I had to create some workarounds to compensate for the missing methods. ...
0
votes
0answers
25 views

how to properly use Libgdx DragListener class

A problem I encountered when trying to implement drag for my hud element is that is keeps shaking/vibrating. This is the implementation: ...
1
vote
2answers
27 views

Why do actors stretch when I add them to a stage in LibGDX?

I have started learning LibGDX and I have been making a few little games to learn how it all works but ever since I started using stages and actors, all of my textures stretch horizontally and I can't ...
0
votes
0answers
58 views

Rendering model shading to frame buffer/texture for use on another model

I'm currently working on a game with a pixel-art style, but the visuals are accomplished by rendering 3D voxel-style meshes at an angle. Now I would like to add sub-pixel animation to the models by ...
0
votes
0answers
30 views

LibGDX new project, immediately fails upon running

I've been trying to setup libgdx, I used the gdx setup jar to build a brand new project that had desktop, android, ios, and html. This worked great until I went to run the game using the below ...
0
votes
0answers
9 views

How to properly index countries for a pallette-swap in glsl?

I've been playing alot of EU4 (think: 3D historical Risk+ set in the 1400's-1800's) lately, and decided that it would be interesting to implement a map like the one in those games. To do this, I have ...
0
votes
1answer
45 views

How do I get the distance between 2 actors in LibGDX?

How do I get X the distance between 2 actors in LibGDX?
0
votes
0answers
14 views
4
votes
1answer
147 views

Weird shader behavior on different devices

I'm trying to combine an ordinary shader with a Single Distance Field shader (for fonts and scalable icons) into one shader program. The idea is simple - if uv.x is less than 1.0, it is drawn as ...
1
vote
0answers
73 views

LibGDX TileMap problem

my LibGDX map find olny two Layers but the map.tmx file contains more than two layers. Where is the problem? ...