A game library which enables cross-platform game development in Java, with support for Android development and desktop development. It makes use of OpenGL for portability.

learn more… | top users | synonyms

0
votes
0answers
6 views

TiledMap blocks makes Animation invisible

I just implemented my animations but now I discovered a problem with my TiledMap. Here some Screenshots: Code for 1 spriteBatchForeground.begin(); // mapManager.render(); ...
2
votes
1answer
16 views

How can I repeat a Texture Region in libGDX

I have a texture that is part of a sprite sheet. I want draw the texture to cover a certain length, but I want it to repeat not stretch. However,when I use the following code batch.draw(hillBottom, ...
4
votes
1answer
132 views

LibGDX input y-axis flipped

I'm writing a game in Java for Android using LibGDX, and I connected my phone so I can test it on it. I know that LibGDX's render system works different than regular Java systems since the 0,0 ...
-1
votes
0answers
27 views

Level Backgrounds [duplicate]

I'm developing a game using libGDX but am still new, especially when it comes to designing sprites etc. So far for my sprites I've used only GIMP. However, for my game I also need different level ...
0
votes
0answers
10 views

Filling the viewport area of a orthographic camera with an image (libgdx)

So im trying to get the whole area of the viewport and then use the coordinates to draw images in the camera's viewport. So if the camera moves I can fill it with one image the length and the width of ...
1
vote
0answers
26 views

Efficient Collision detection for polygons (fleet) in an RTS

I'm trying to make an RTS for android using libgdx. I would like to have collision detection to be able to detect ships inside the range of weapons and collision between my bullets and the ships. So ...
0
votes
1answer
27 views

How to make sure that when two bodies collide, there is only one collision detection on box2d?

I'm using LibGDX with box2d, and when to bodies collide collision is detected multiple times.
2
votes
1answer
28 views

2D LibGDX Collision Avoidance [duplicate]

I would like to know what is the best way to implement collision avoidance and eventually pathfinding in a LibGDX 2D top view game. Think of "Binding of Isaac". I use a sort of tilemap to place the ...
0
votes
1answer
21 views

Move a box2d body towards mouse [on hold]

I'm using LibGdx's Box2D in Java. I'm trying to apply a force to the body that would send it towards the mouse. The problem is, I'm having trouble figuring out a way to send it directly to the mouse ...
1
vote
1answer
44 views

Using world coordinates instead of pixels

I've been told that having a set pixels-per-world unit number is bad practice because it will not look the same at different resolutions. Because of this, I am trying to learn about using abstract ...
4
votes
1answer
53 views

How do I convert screen coordinates to isometric tile map coordinates in libGDX using matrices

I know this has been asked many times but my question doesn't quite fit the others. I have an IsometricTiledMap and I need to get the tile under a set of screen X and Y coordinates. Here is a picture ...
-1
votes
0answers
22 views

LibGDX : Scene2D [on hold]

I wanna make the right scrolling button smaller and the buttons inside it to touch the right edge of the Table inside the ScrollPane, the buttons are smaller the left grey part is the background of ...
1
vote
0answers
18 views

LibGDX - ShapeRenderer as principal game entity renderer

I am trying to make a 2D game that is just a bunch of default figures like circles, arcs and quadrilaterals with no textures (similar to Super Hexagon), and for that I was using C# and XNA a long time ...
0
votes
0answers
13 views

Scaling/Zooming a SpriteBatch

I am working on my first game with LibGDX and coming from ActionScript3 I am used with the possibility of scaling things more or less the way I want. I know it works different in LibGDX, but I can't ...
2
votes
1answer
34 views

How to achieve sprite reflection effect in libgdx

I am currently working on an open world game similar to Pokemon using libgdx. I am currently stuck on this effect that I really want to be done before moving to other features of my game. How can I ...
0
votes
0answers
34 views

Is the libgdx g3d model format really most efficient? [closed]

The libgdx wiki says that libgdx's g3d files are more memory and runtime efficient than others. Is this really true? I can see no major reasons why libgdx g3d models any better than the common obj ...
0
votes
0answers
14 views

Libgdx polygon ratating

I'm using polygons for collision detection. Here is the code: poly = new Polygon(verticies); poly.setOrigin(100,100); poly.setRotation(45); renderer.setColor(Color.GREEN); ...
3
votes
1answer
35 views

How do I use Libgdx viewport for UI?

I am using LibGDX to make a game for Android and I am using 2 Viewports. One for UI and one for the actual game content. My problem is I can't find a good way to scale my UI using a Viewport. This ...
0
votes
1answer
14 views

How can I use OpenType Font in libGDX

Is there a way I can use an OTF file with libGDX. The following throws an exception: gameFont = new BitmapFont(Gdx.files.internal("data/font.otf")); Caused by: ...
0
votes
0answers
11 views

LibGDX : Scene2D ScrollPane

I want to create a list of buttons with ScrollPane , but I cant create a ScrollPane . In the constructor method in the examples Skins are used (.atlas , .json files) but how to create these files? ...
0
votes
2answers
60 views

How to use world coordinates

I am quite new to game development (but not programming) so please forgive me if I am not correctly understanding certain concepts. I am trying to figure out how to use world coordinates rather than ...
0
votes
1answer
36 views

Libgdx - How to rotate a single ShapeRenderer object

So, looked at a couple of questions similar to this, led me straight into dead ends. I have an object drawn out in ShapeRenderer, and I wish to rotate only that one object. I have tried ...
3
votes
1answer
58 views

Box2d Body to follow mouse movement

I am trying a box2d body to rotate following the mouse. Here's an image to clarify what I mean. The red and blue circles are current point of the mouse and the body (of corresponding color) ...
0
votes
1answer
23 views

LibGDX - how to detect touchUp with GestureListener?

I'm making a game and I have implemented GestureListener as my inputprocessor. It came with a bunch of methods such as fling, pan, tap etc etc including touchDown. However, there is no touchUp method! ...
0
votes
1answer
35 views

LibGDX - Tilemap Wall Collision Detection Issues

I cribbed some code from another web tutorial (SuperKoalio - https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/superkoalio/SuperKoalio.java) about detecting a ...
0
votes
1answer
41 views

How to fetch unit coordinates for AI?

I have been designing a simple turn based Civ-like game over the last two days with libGDX to test myself. I have a units class that can be extended to make unit types and I have my game board set ...
0
votes
1answer
33 views

Libgdx Scene2d and Box2d light

Currently I am using scene2d and I want to implement shadows using Box2d light. I want shadows under characters but when I draw something after render() , it draws nothing. For example, in draw() ...
0
votes
1answer
26 views

How to store each rendered frame as image in libgdx for debugging

I have a libgdx screen's render method where I am executing lots of for loops and drawing various shapes on screen in thoese loops. Also I am manupulating (x,y) of each shape at runtime to acheive a ...
0
votes
1answer
32 views

Camera.unproject(Vector3) method is not working in libGdx

I know the touch postioning in libGdx uses OpenGL, making 0,0 the bottom left corner while the camera uses the top left corner as 0,0. I did some searching and found this SO question that specifies ...
0
votes
0answers
7 views

Libgdx : how to attach actor to a rotated group

I have a group actor with a circle image .png and then I spread small circles around surface of this group, I mean circle on angle 0 and circle on angle 60 and so on using the math equation: ...
0
votes
0answers
26 views

Kryonet with multiple clients overhead server, how to deal with this? [on hold]

I'm developing a server-client multiplayer game using Kryonet and libGDX. My server contains 100 entities and sends updates at 20 packets per second to clients using udp. Each packet contains the 100 ...
0
votes
1answer
60 views

LibGDX obstacle collision

How can I handle collisions with obstacles in LibGDX? Is there any automatic way to stop the character's movement when it collides with a wall or I have to constantly poll for all the possible ...
1
vote
2answers
65 views

LibGDX - Rendering things in different classes

thanks for your time! I'm really new to LibGDX (and Java itself). Which approach should I use to render my different game parts? I want to show a background, the main character, a bunch of enemies ...
1
vote
0answers
15 views

LibGDX's particle emitter - Multiple particles in the same effect?

Hello everyone reading this, I've used the particle editor to edit an effect to put in my game. Is it possible to have multiple and randomly emitted images (particles) instead of one? I don't want ...
-1
votes
0answers
17 views

Set the camera to follow a TextureRegion

I need to set the camera to follow an object like the player, I've seen some tutorials where two lines of code can solve this, like: camera.position.set(xPos, yPos, zPos); camera.update(); For my ...
0
votes
1answer
58 views

How do I manually make a .pack file like TexturePacker (without using TexturePacker)?

I am using libGDX and apparently the only way I see for creating a UI is with texture packs. I would say that since a texture pack is nothing more than JSON or XML file and a large png I could ...
0
votes
0answers
24 views

LibGDX - Show a minimap

I've started to develop a small roguelike game in LibGDX. I've also made a minimap class, which creates and updates the minimap as the player explores the dungeon, by using a Pixmap. The minimap class ...
-2
votes
1answer
43 views

Libgdx Statebased game not working

I'm using Libgdx and I wanted to change the default application to a Game with multiple screens. I get an odd nullpointer that has to do with the engine. I'll show you my little setup code. Here I ...
3
votes
1answer
59 views

Making a border around a translucent shape in LibGdx

The recommended method for making a border around a shape using LibGdx is to draw a larger version of the shape to serve as the border, then draw the shape over the larger image. ...
1
vote
1answer
25 views

[Libgdx]Screen not rendering after restarting game

I have a strange problem while using the libgdx library Game works fine on the initial launch on Android, but after that restarting game does not render the graphics on the screen properly. It is a ...
0
votes
1answer
38 views

Libgdx Platform collision problem

I am trying to come up with a collision function where all the cases are made. If the player (Who's hit box is a circle) collides with a platform (hit box is a rectangle) from the right the ...
1
vote
1answer
47 views

Box2D No Gravity when moving against wall

I use Box2D in my current project and I have a problem with the gravity.. You can see my problem here: https://www.youtube.com/watch?v=2_kv9LkKwN4&feature=youtu.be when i jump normal everything ...
2
votes
0answers
27 views

LibGDX Android Textures reload other textures, and transparent images get black backgrounds [Pictures]

I have very strange problems with my LibGDX Game in Android - The problem is that sometimes the textures get black backgrounds when they should be transparent, and sometimes when I remove the texture, ...
2
votes
1answer
76 views

Creating a Melee Weapon in Box2D (libGDX)

I am struggling with how to implement a melee weapon that can swing when a key is pressed. I am imagining two different attacks (stab and swing) I have tried creating two fixtures (character + ...
0
votes
0answers
20 views

Problem loading particle effect

I am trying to load a particle effect, but I get an error when libGDX tries to load the image file for the particles. Couldn't load file: - Image Path - The particle effect file itself loads fine. ...
0
votes
0answers
38 views

Use libgdx box2d for dynamically generated top down map

So, I've already found some information on how to use box2d and tiledmap together. Since I want to generate my top down map (100 by 100 tiles), I thought about only using box2d. The tiles would be ...
-2
votes
1answer
54 views

Libgdx array of Vector2 closest point

I have an array of objects. Their position is a Vector2 (x, y). I want to select the closest object, given a (x, y) coordinate (that represents an user touch on screen). Searching on web I found a few ...
0
votes
0answers
20 views

LibGDX , Box2D body Mass Center

I am creating complex bodies using this editor. But the mass center of the body is not in the right place , when I apply force to it it begins rotating . So I am confused why is the masscenter in the ...
0
votes
1answer
59 views

Libgdx understanding screen size

I'm trying to create my own jumper type game where the player moves up through an infinite y value. The problem I am having is getting the screen size to match up with the android screen. viewport ...
0
votes
0answers
27 views

LibGDX strange status bar in background [BUG]

I released an app and I noticed that some devices has a strange "bug" which I don't know if it's caused by Android, me or LibGDX. That bug is related to status bar, normally app let you see the bar ...