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

2
votes
1answer
18 views

Sounds overlapping when playing too many at the same time

I am pretty novice when it comes to game sound management, so excuse my ignorance. I am having an issue when playing too many sounds at the same time where some sounds stop playing, or doesn't play ...
0
votes
1answer
10 views

LibGDX buttons bounds are wrong

I am making a simple gui in libgdx and run into this problem ; when you click on the button it's bounds (?) are wrong since if I click under it, the game registers it as a click. On the other end, ...
-1
votes
0answers
24 views

Design the game Stage in libgdx

Let's assume my Stage has this structure: A Table with cells (like a matrix) centered in the screen Each cell of this Table has an Actor associated to it I have to add actors also in the remaining ...
1
vote
2answers
66 views

How to make sprite move in any direction?

I have an arrow sprite that rotates based on where my cursor is pointed, I can only make it move up,down,left and right.How about in a diagonal way? //this is the rotation nt x=Gdx.input.getX(); ...
2
votes
1answer
71 views

2D - Smooth lighting with shadows for a tile-based game

for the last week or so I have been completely stuck on trying to implement efficient lighting. I've been researching and experimenting and I've looked everywhere that I have been capable of finding, ...
1
vote
2answers
27 views

How can I add extensions to libGDX

I had a problem with my Font in a game I am developing in libGdx. After some googling I was instructed to use the following code: private void createFonts() { FileHandle fontFile = ...
1
vote
1answer
26 views

Scene2D: How to use Image.setDrawable()

I'm trying to change the texture of an Image actor on my Scene2D stage, however I can't seem to get it working. It seems like setDrawable() doesn't really do anything. For example, this will make ...
2
votes
0answers
19 views

balloon ligher than air with libgdx, impementation of FixtureDef.density, gravityScale, linearDamping?

I use libGdx/box2d's physic. My intention is to create a balloon filled with helium (a body, what hovers above a surface, if we apply a little force to it - it moves fast but not far, if we push ...
1
vote
1answer
17 views

How to scale LibGdx TextButton?

Apparently textButton.setScale() is not working. Even when the scale is set to 0.1, the button is displayed in it's original size. How to properly scale a TextButton in LibGdx? The official ...
1
vote
1answer
13 views

libGDX sprite image not updating Event Handling InputHandler

I created a separate inputHandler class implementing InputProcessor. I'm using Event Handling (libgdx github page: https://github.com/libgdx/libgdx/wiki/Event-handling) public class inputHandler ...
1
vote
1answer
28 views

libgdx continuous movement while touch and hold (even after jump)?

So, I have these buttons where I have implemented a method to handle 'touch and hold' (without polling). If the player touches and holds the walk button ..it will keep walking till the button is ...
2
votes
2answers
58 views

LibGdx TextField - Hide Keyboard when not focused - How to?

I'm creating a registration screen for my game. I implemented textfields and input is getting correctly. But when I click elsewhere after text is entered, the keyboard stays visible and does not hide ...
1
vote
2answers
66 views

How can check a collision between 2 non-axis aligned boxes?

I'm making a simple and easy game and I need to detect the collision between 2 boxes. It only needs to return trueor false, no physics involved. I started working and couldn't find an algorithm that ...
0
votes
0answers
15 views

Design a grid with draggable Actors

A quick overview about what i want to do. I want to make a grid 5x5 centered in the screen in which each cell can contain an Actor that can be moved in another cell. An Actor can be of any type, ...
1
vote
1answer
37 views

Playing with hashmap in drawing

I'm developing a game in Java for Android, using LibGDX. In my render(), between the batch.begin() and batch.end() I'm running through all the game objects and draw them. Every game object is stored ...
1
vote
1answer
23 views

How do I query a LibGDX Box2DLights “light” and “dark” regions?

I have lighting implemented using Box2dLight. I want to update/render things inside the player's PointLight area. Stuff in the dark area should not be rendered. How can I find which areas are lit or ...
0
votes
1answer
42 views

2D Collision Response

I am trying to implement collision response in my libgdx game. I'm using Rectangle objects as my bounbing boxes. This makes collision detection very easy, however I can't quite get the response ...
3
votes
1answer
46 views

Using deltaTime and Frame Rate Independence

I'm working on one of my first games and I've read that linking your game logic to FPS is bad because it will run differently at different FPS (obviously). I have already made some of the basic game ...
0
votes
0answers
29 views

NullPointerException in android.app.Activity.onCreate(android/app/Activity.java:874)

I'm trying to get libGDX 1.6.1 to run on Android via Ruboto. So far, I: Generated a new libGDX app using the app generator Got the desktop app to run (Java) Got the android app to run (Java) ...
1
vote
1answer
23 views

LibGDX viewport touch coordinates transformation

I've been trying to get LibGDX's viewport and camera unproject() to work and so far none of the tutorials/answers I've found have worked for me. I have a game window of 840x480 units with ...
-1
votes
0answers
27 views

Level generation with libgdx [closed]

Hello i am designing a game with libgdx for android. Now i want to create different levels for my game. the game will include about 200 levels. levels are only about changing some variables in ...
1
vote
0answers
36 views

Libgdx performance on old devices

I'm developing a game in Java for Android, using LibGDX. I'm using Nexus 5 to test my game most of the time and it works great (Minimum FPS it gets is 57 out of 60). Recently I ran my game in Galaxy ...
0
votes
0answers
21 views

Box2D collision between dynamic body

I'm implementing Box2D for my 2d top down LIBGDX game and i have some struggle with two dynamic body. Currently, my two bodies are created that way : BodyDef bodyDef = new BodyDef(); ...
1
vote
1answer
29 views

libGDX: Why doesn't Gdx.input.isKeyJustPressed() work?

I'm trying to use the method Gdx.input.isKeyJustPressed() to check if the Android BACK button was just pressed. I don't want to use the Gdx.input.isKeyPressed method to avoid multiple calls. Here is ...
0
votes
0answers
24 views

How to “pause” stage actors listeners

I have a problem with multiple stages and listeners in libGDX. I have GameScreen with gameStage (contains game elements), uiStage (score label and pause button) and pauseStage (resume, restart and ...
0
votes
1answer
29 views

I can't understand the batcher.draw at libgdx [closed]

here is the code: batcher.draw(birdMid, bird.getX(), bird.getY(), bird.getWidth() / 2.0f, bird.getHeight() / 2.0f, bird.getWidth(), bird.getHeight(), 1, 1, ...
1
vote
1answer
35 views

How can I add a transparent overlay to a UI in libGDX?

I am attempting to use the following code shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); shapeRenderer.setColor(3,3,3,.3f); shapeRenderer.rect(0,0,gameWidth,gameHeight); ...
1
vote
2answers
39 views

LibGDX - Managing a Minimap

I'm making a top-down strategy game so I thought a minimap is a must. I'm using Scene2D to display my GUI and since the minimap is technically a part of the GUI, I used the stage camera to position ...
1
vote
1answer
67 views

What size should i use for my game design?

i am currently working on a android game by using libgdx and i am designing graphics with ps for it. I want my game looks the same quality for different screen sizes but i dont know in which size ...
3
votes
1answer
59 views

Does libgdx implement the game loop for you?

Initially, I assumed that the developer has to implement the game loop because libgdx is a library - not an engine. But then I found out that Graphics has getDeltaTime() and getRawDeltaTime() so I ...
5
votes
1answer
241 views

Why does flipping 1 texture region cause an identical texture region to also be flipped? (libGDX)

Sorry for the bad title. I didn't know how else to explain it. The following is a portion of my code: public class AssetLoader { public static TextureAtlas spriteSheet; public static ...
1
vote
1answer
35 views

libgdx Vector.cpy question

Why do people use this: public void set(Vector2 v) { this.vector2 = v.cpy(); } insted of just using: public void set(Vector2 v) { this.vector2 = v; } What I don't know that I should ...
1
vote
0answers
14 views

Error in projecting coordinates from FitViewport to screen in LibGDX

i'm using a FitViewport to render my "game world". Viewport virtual dimensions are fixed 400x240. I use viewport.unproject method to scale input touches from screen coordinates to world coordinates, ...
1
vote
0answers
16 views

Scale smaller resolution to full resolution libGDX

Short question about the scaling in libGDX. At the moment i have a application with the resolution 480x320. I define this in the main method of the desktop launcher. My whole application is now ...
1
vote
1answer
30 views

Libgdx libraries are missing from gradle cache after I reinstalled my system (IntelliJ)

I reinstalled my OS (Linux Mint) today and copied all my projects over to a flash drive. After I was done setting everything up I copied 'em back over again and started to fix the problems (caused by ...
2
votes
1answer
35 views

Should I initialize a Box2D World per Level?

I'm using a LevelManager to load Tiled maps in my libGDX game, which stores: Static: final Size of map in Tiles final Size of map in Pixels final Size of an individual tile TiledMap ACTIVE_MAP ...
0
votes
1answer
33 views

AssetManager proper usage in libgdx

I am a beginner in libgdx and I am coding a simple game. This game is like a word puzzle where each letter is a texture. Before loading the first level I need to load into memory 26 textures, one for ...
0
votes
1answer
40 views

Collision with player following mouse

I'm making a RPG with libGDX. I've loaded a TiledMap and now I'm implementing the player movement. The view is top-down. In my game I want two ways of input: one is using the ARROW keys to move the ...
0
votes
0answers
18 views

3D Model is existent, but not rendering in LibGDX

I'm trying to render a simple model in libgdx. I tried ObjLoader, G3DLoader, and Asset loading but nothing works. I know the Model is actually there because when using a different batch besides the ...
0
votes
0answers
17 views

Raycast trouble

i'm having some trouble with the RayCast. I'm raycasting from the player position and my mouse position. I have this situation : http://i.imgur.com/h7iplnY.png (the white line is a representation of ...
2
votes
1answer
49 views

Drawing textures off screen optimization required?

I recently started using LibGDX and I am wondering if I have to optimize my code when drawing textures/sprites off-screen, just like I used to do with XNA. My biggest concern here is specifically ...
3
votes
0answers
90 views

HTML/JS publish LibGDX

I want to publish an app created with libGDX (HTML/JS publishing). Here are the steps I am doing. Right Click on the Project -> Google -> Gwt Compile -> Compile. After the compilation there is no ...
0
votes
0answers
15 views

LibGDX : Textfield input type

I want to change TextField input type . When I click on the textfield the android keyboard appears with all the symbols , but I want only numbers and dot (.) . TextFieldStyle textFieldStyle = new ...
0
votes
2answers
63 views

Static spawning locations for players, creatures, items in Tiled map editor

I am using Tiled map editor. I am trying to add static spawning locations (x,y) for various entities (lets say 15) in my game. The best idea I had so far is something like this: I am using a ...
0
votes
1answer
64 views

Tiled object layer draw sprites

I added some tiles to some object layers in my tiled map and now I want to draw them in game. I tried to render everything with mapRender.render(); but the tiles doesn't show up. Then I tried to ...
1
vote
1answer
66 views

How to use mipmap with TextureAtlas and AssetManager

I searched on the Internet but couldn't find the way to use mipmaps with libGDX TextureAtlas. I want atlas instead of normal textures because as far as I know mipmap supports only 2^n width and height ...
1
vote
1answer
29 views

Running and Jumping using Box2d and libgdx

.this is my first trial on making a 2d game and currently struglling how to run and jump smoothly. My problem is when the player keep pressing on left or right botton then jump. the player won't jump, ...
3
votes
2answers
48 views

LIbgdx android app remove fullscreen and show titlebar

I am developing an app using libgdx and i dont want the app to go fullsceen and i also want to show the title bar but the app goes to full screen and hides title bar instead of all efforts. here is ...
0
votes
1answer
35 views

LibGDX: Colllisions between bullets and enemies in arrays

I am writing a "Gauntlet" style game. So far I have managed to successfully detect collisions between my player object and my ghost enemy objects, and when they collide they drain the player's energy. ...
0
votes
1answer
40 views

Stop rendering hidden objects libgdx

I currently am hiding objects that are not in the frustums view. However, some objects are still being rendered that are in the frustums view, but are hidden. My goal is to not render objects that ...