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
0
votes
0answers
10 views

Get json response in libgdx

I am trying to get json response in libgdx. Here is my libgdx code. ...
0
votes
0answers
11 views

how to create button to change screen

i have a problem with my code. When I add a button to change the screen, a crash occurs or takes a long time to convert to the other screen, and this is my code ...
1
vote
1answer
12 views

LibGDX HexagonalTiledMapRenderer wrong stagger index?

Im using Tiled map editor, Hexagonal(staggered) map, libgdx version 1.9.9 If I set staggeredIndex = even in tiled map editor, ...
0
votes
2answers
35 views

Calculate size of hexagonal map libgdx

I have a staggered hexagonal map created with "tiled" map editor and I want to calculate the height of this map in pixels, the example map below should be ...
0
votes
0answers
29 views

How to render 3d object as 2d with different angles

I wanted to make a ship as a 3d object and import it with an atlas file to my 2d libgdx project with different angles like I saw it by another game. And I was wondering if there is a specific ...
0
votes
1answer
33 views

How do I rotate TextureRegion to face a point?

I am trying to rotate a texture region so that it will face to a point. This is a video showing my current implementation please have a look to understand better(as you see no rotation but i can ...
0
votes
1answer
22 views

how to use preferences in libgdx

I am trying to save a username for game in preferences (first time user enters the game, registration screen shows up, and after that whenever user enters the game, username is automatically ...
0
votes
1answer
39 views

Moving cars on a tiled map

I'm writing a game which is situated on a tiled map. I have a PlayState on which there's a Board which cosists of Fields. My Board is an isometric map of a city, where each tile is a kind of road. ...
0
votes
1answer
18 views

Libgdx: converting between two camera coordinates

I had a similar issue to the question here: Why is my text is too large even when scaled to .05f in libGDX? So I created a second camera for my text elements. I'm rendering the text above some other ...
2
votes
1answer
54 views

How to draw a string into a polygon? (Libgdx, Java)

I am working on a 2D grand strategy game (like Hearts of Iron from Paradox but as I said only 2D game) and I would like to render the area names on the map. I made the Polygons for each area. How can ...
0
votes
0answers
20 views

How can I archive a Big TiledMap with LibGDX?

I'm trying to archive a big map on my game, 2400x900 of 64x64 tiles using TiledMap and LibGDX. What is the difference in performance of using a 100x50 tiledmap vs a 2400x900 map? Say they both have ...
1
vote
0answers
21 views

Moving with rotating in 3D world in Libgdx

I'm trying to create a first person system in my game which consist of a big cube with grass texture , so the problem happens when I move and try to rotate the camera the world rotate and I'm not on ...
0
votes
1answer
78 views

How to make a world map from image like in paradox games? (Java, LibGDX)

I'm working on a grand strategy game similar to those made by Paradox Game Studios with their Clausewitz engine. I'm trying to create the world map from an image. On that you can see the areas, and ...
0
votes
1answer
24 views

Graphic render speed in libgdx using many sprite sheets

I am currently working on a customizable Player-character for my top down view 2D pixel game. I am using libgdx and aiming for android devices as well as desktop applications. I am wondering about an ...
0
votes
2answers
34 views

Disposing objects when changing screens

I'm making my first game with LibGDX and Box2D, and I've realized that the memory used increases when I change screens. It starts from 150MB and progressively reaches 850. How should I deal with this? ...
0
votes
1answer
83 views

How does the stateTimer parameter is initialized in this method getKeyFrame(stateTimer)?

I have been following the tutorial https://www.youtube.com/watch?v=1fJrhgc0RRw&list=PLZm85UZQLd2SXQzsF-a0-pPF6IWDDdrXt&index=11 I an not able to understand what is stateTimer in getframe ...
0
votes
1answer
34 views

LibGDX FileHandle does not delete file

I'm using this line of code to delete a file: if(Gdx.files.local("/files/ids.json").exists()) { Gdx.files.local("/files/ids.json").delete(); } The same code ...
0
votes
1answer
29 views

Pause Tiled animation during game in LibGDX

I’m using Tiled with LibGDX and I have some animated tiles. When the game is paused I would like their animation to be paused as well. Is this possible? The map is drawn with ...
1
vote
0answers
49 views

How would I go about serializing my LibGDX game?

I am currently using Kryo for serialization. I have a Player class, but it extends Sprite. Sprite isn't serializable. This means I can't serialize Player as a whole. Is there another way to do this? ...
0
votes
0answers
19 views

Dealing with ghost vertices of Kinematic bodies in Box2D

I'm using LibGDX and Box2D and I want to have multiple falling platforms in a row which will fall sequentially as the player runs on them, like in the picture below. (the shapes are parsed from Tiled) ...
0
votes
1answer
29 views

How to launch Libgdx cross-platform (Android, HTML, Desktop) multiplayer client with socket?

So i'm struggling with making my cross-platform client side to work, specifically on HTML part. I have java server that is responsible for all the controls and events, and I control it via netty-...
1
vote
1answer
19 views

Extending the camera vs CameraHelper class vs camera field

I am following an eBook called "Learning Libgdx Game Development" In it, the author implements a CameraHelper class that implements ...
0
votes
0answers
19 views

Optimal way for adding text inside a LibGDX ProgressBar?

I have a working healthbar set up for my game. But I also want the health to be displayed inside the healthbar as text. So for example something like "365 / 900", meaning the player has 365 hp out of ...
0
votes
1answer
25 views

Aligning animation frame assets with different sizes

I have code that changes texture in each frame depending on the player's state - walking, idle. My problem is that the idle texture (from separate png) has a slightly different size, and due to that ...
0
votes
0answers
11 views

Libgdx Touchpad Edge Detection

I have implemented an on-screen touchpad that controls my player shape. I can move the player based on the changes on the touchpad knob using the ChangeListener ...
0
votes
2answers
35 views

Box2d: Destroy body or setActive to false?

What is better practice when a body goes out of screen, to destroy the body or just setActive(false)? I guess in terms of memory it is better to destroy it and free the memory, but is destroying ...
0
votes
0answers
22 views

How can I add background color to a libGDX TextButton?

I have a TextButton in my libGDX project and I want to add a color background to it. I tried the setColor() method but that didn'...
-5
votes
1answer
49 views

When making a game using libgdx the program immediately closes when being run

The problem is similar to my last question, but some of the errors are fixed. The file: ...
-3
votes
1answer
32 views

Making a game using libgdx and when running the program immediately closes [closed]

When I run the program the window immediately closes and gives some errors. GameMapImpl.java : ...
0
votes
1answer
89 views

Multiple Bitmaps in Rectangle area

I am trying to build a card based game in which a card is added to player after every round. To win the match player has to remove all cards from his deck. However I have also drawn some additional ...
0
votes
1answer
39 views

LibGDX/Tiled rendering order

I'm using LibGDX and Tiled. I need to render a Texture for my repeated background, then myTiled map and finally the sprites. My problem is that if I put ...
0
votes
1answer
40 views

Libgdx - Screen tearing (or artifacts) while in fullscreen

I have a problem with libgdx, fullscreen and what I believe is screen tearing or any other sort of artifact. In windowed mode, everything works fine, but when i switch to fullscreen, moving sprites ...
0
votes
0answers
31 views

Box2D - Proper way to simulate player's body and feet

I'm new to LibGDX and Box2D, and I'm trying to create my player's body but got some issues. I've created the ground as a ChainShape, and my player as a Rectangle. I want to attach a fixture for its ...
0
votes
1answer
48 views

Libgdx - accelerating string displaying

My renderBoard is slow and it's because of font.draw function. I read that I should use stringBuilder instead of string, but it didn't help at all. I suppose I'm using it wrong. Could you guide me to ...
0
votes
1answer
21 views

LIBGDX - Artifacts when scaling background image

I've got a problem with libgdx. First off, im working with libgdx and box2d on a little physics game. Im using the aproach mentioned in this answer and thereby setting my camera to some smallish ...
0
votes
0answers
25 views

Tiled map .tmx to Atlas Region libGDX

I have some tiled tmx maps I made. I have a texture atlas that contains all of the textures I'm using in my libGDX game . I have a json tiled map saver class I wrote that stores the atlas region ...
0
votes
1answer
28 views

Why the value of float xAxis = -Gdx.input.getAccelerometerY(); is given a accelerometer of y axis?

I am learning game development from the udacity course "https://classroom.udacity.com/courses/ud405/lessons/5389263706/concepts/53853441090923" I am stuck with one statement in the code about ...
0
votes
1answer
25 views

(Tiled) Background stops being rendered in libGDX

I'm using Tiled and I created my background as an image in a Tile Layer. When I load the map in LibGDX, it shows fine. However when the camera moves, the whole background dissapears. The problem is ...
0
votes
1answer
81 views

Game loop inside libGDX game loop

I have the main game loop in libGDX. On the touch() event I want an animation to be executed. So I will have a variable which will store the value which will be ...
0
votes
1answer
30 views

x coordinates resets after changing speed?

I wanted to change the speed of a soldier when he enters a barbed wire texture. Since I have multiple soldiers and multiple barbed wires I just iterate with two for-loops through all of them. ...
1
vote
1answer
39 views

What is the exact unit in LibGDX if it says “private static final float WORLD_SIZE = 480”?

In the code I see that the WORLD_SIZE variable was initialized with 480 private static final float WORLD_SIZE = 480; What exactly the 480 means, are they pixels, cm or meters?
1
vote
1answer
36 views

Unexpected output from the merging of a quadtree, when that data is converted to Box2D fixtures

I've been staring at this code trying to troubleshoot this for the past 3 days, but I seem to have gone Code Blind. I KNOW the issue is stupidly simple, but I just can't crack the problem. I'm using ...
0
votes
0answers
37 views

LibGDX: Issues with two viewports, one from stage

I am frustrated.^^ I want to build a game that can run on different screen sizes using LibGDX. The best strategy for me seems to be to use a FitViewport so that I ...
1
vote
1answer
46 views

What is the connection between these LibGDX concepts?

In LibGDX, what is the connection between these concepts: stage, camera, viewport, batch (spritebatch), projection matrix, tiledmap? Currently my game has 3 stages: UI stage entity stage tiledmap ...
1
vote
1answer
41 views

Texture with transparency not rendered correctly in LibGDX

The title might be a bit misleading but I'm having a hard time to explain the problem so I'll try with pictures: Same tree from opposite site: I'm trying to create a voxel game and at the moment I ...
0
votes
1answer
30 views

Why can I not open the desktop and core folders in libGDX?

I think the problem is caused beacuse I have two JDK's. One dedicated one and another integrated from Android Studio. Before, when I start the bulid it gave me a warning: ...
1
vote
1answer
35 views

Action never fires

I have a method, which runs the action MenuScreen at the very end. It never fires. Why is that? ...
0
votes
0answers
32 views

libGDX - Zooming on a specific point in 2D space

I was hoping to modify my game so zooming would focus on a point: the mouse location on desktop or the midpoint between two fingers on mobile. This appears to require a simultaneous zoom and translate....
0
votes
1answer
62 views

How to get collision area within a circle in libgdx

I have a ball inside of a multi-colored circle, the ball will hit the inner area of the circle like this bellow circle image And the Circle will be rotated clockwise or anti-clockwise based on user ...
0
votes
1answer
60 views

Missing texture after add new actors

I want to add two types of characters multiple times but when I add a new actor to stage texture in "old" actors stops render. I can add multiple KnightActor (...