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.

learn more… | top users | synonyms

1
vote
1answer
17 views

2D BoundingBox Collision Detection Problem

I implemented collision detection into my game (using Bounding Boxes) The character is floating above the blocks instead of standing on them. I know what is happening, but I can't figure out how to ...
1
vote
2answers
6k views

Handle Input Processor in Device Back Button and Button as Actor

How to handle a event for both key as well as actor added in the screen? My problem is that at a time only one input processor is available either for button or device back button. How can I set input ...
0
votes
1answer
30 views

LibGDX - How to draw a filled rectangle behind a text?

I'm new in LibGDX and I want to create a grid based game. Every square will have a rectangle and a text and the background color of the rectangles can change during the game. The problem is when I ...
1
vote
1answer
744 views

Multiple enemy array in LibGDX

I am trying to make a multiple enemy array, where every 30 secods a new bullet comes from a random point. And if the bullet is clicked it should disapear and a pop like an explosion should appear. And ...
1
vote
1answer
43 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
1answer
20 views

Libgdx: more efficient way of using Vector 3?

I currently use if(cam.frustum.pointInFrustum(new Vector3((float)posX, (float)posY, 0))) To check if my sprite is in the camera's view. I have to make a new Vector3 every frame wich is very ...
1
vote
2answers
76 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 ...
3
votes
2answers
131 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
189 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
29 views

How can I communicate between libGDXand the Android Studio Java files?

The reason I'm asking is because I wanted to create a game and I know I could use Scene2D to create the UI but as far as menus go I wanted to use the tools in android studio to at least create a menu ...
15
votes
5answers
15k views

How do I make an on-screen HUD in libgdx?

I'm new to libgdx, and I am finding I am getting stumped by the simplest of things. It seems to want me to do things a specific way, but the documentation won't tell me what that is. I want to make ...
0
votes
0answers
36 views

My characters do not reverse their velocity, why? libGDX

I have been programming my game in libGDX for a while now and even watched a tutorial on youtube from Brent Aureli. The game I'm going for is kinda like Super Mario Bros but there is one problem that ...
0
votes
0answers
49 views

LibGDX: Problems creating custom actor

I am creating a custom class that extends from Actor,just like this: public class MyActor extends Actor { ProgressBar bar; Label nameLabel; TextButton button; public MyActor(String name, Skin skin){ ...
0
votes
1answer
43 views

How to make a ball hit many tiled circular objects in LibGDX

Hey guys I've been learning to make games with LibGDX. I did a tiled map in Tiled and the rest of code in java using Android Studio. I could make a ball bounce on the flour using Box2D, but I can't ...
0
votes
1answer
165 views

LibGdx - How can I correctly handle tile transitions / connected textures?

So I am making a tiled game and I need to connect textures correctly based on whats next to it. With tiles that had connection really close to the edge of the tile I could just use the 4 bit meathod ...
2
votes
1answer
40 views

Call touchUp() programattically for sprite in LibGDX

I'm trying to call touchUp() for a sprite i've created in my app. i'm getting success but the co-ordinates do not match while i call it manually. final int x = (int)mySprite.getX() + 10; final int y ...
0
votes
1answer
508 views

How to use the zoom gesture in libgdx?

I found the example code for the GestureListener class, but I don't understand the zoom method: private float initialScale = 1; public boolean zoom (float originalDistance, float currentDistance) { ...
2
votes
1answer
64 views

Custom Coloring of Tileset Characters

Games like Dwarft Fortress and Dungeon Crawl Stone Soup are drawing their boards using tiles from a tileset image (I think?). I know you can do color keying and replace the background color with ...
0
votes
1answer
352 views

libgdx - Box2d debug draw not correct

I have a problem where the bodies in my debug draw does not draw correctly, take a look: As you can see, there is some space between the dynamic body and the ground. I have checked the contact ...
0
votes
2answers
517 views

Libgdx box2d crashing

im making a game in libgdx which i having a bunch of circle bodies floating around in space and when the player's body crashes into another body, that body deletes and creates two smaller bodies ...
0
votes
1answer
509 views

Move Box2D body towards mouse click

In a top down game using Box2D, I would like the player's Box2D body to rotate towards the mouse click, and then move to a point on mouse click (move, not teleport). I have worked out the rotation ...
0
votes
0answers
30 views

HashMap or LinkedList

I'm working on a 2D game for Android using LibGDX in Java. In my game I got lots of enemies, bullets and other stuff. I hold a hash map, which every cell holds a reference to an array list of that ...
0
votes
2answers
32 views

How can I make libGDX text buttons look like clickable buttons?

I have this problem with my game where UI build a nice menu and other stuff with TextButtons and labels, but it doesn't look nice because it's mostly displaying the text of the buttons (which don't ...
1
vote
1answer
61 views

libGDX upload z-axis of sprite to graphics card

Background: I want to obtain each fragments position via vertex interpolation to then calculate the light vector for phong shading (L = [Fragment pos] - [light source pos]). Problem: At the moment I ...
3
votes
2answers
69 views

How do I induce collision events in LibGDX 3D?

In the code below I've put an example of something I want to do. I have the camera and I want it to stop moving whenever it hits one of the boxes, how do I do this? public class Main extends ...
1
vote
1answer
282 views

libgdx universal tween engine how to control the tweening speed?

How can i control the speed of a tweening sprite? Here is the code: in create () /*try tween*/ w = Gdx.graphics.getWidth(); h = Gdx.graphics.getHeight(); ...
1
vote
2answers
261 views

Laggy empty project at 60FPS

@Override public void create() { batch = new SpriteBatch(); img = new Texture("badlogic.jpg"); } @Override public void render() { Gdx.gl.glClearColor(0, 0, 0, 1); ...
1
vote
1answer
33 views

Problems managing collision filtering

I have my character fixture and body(is a tank), so when I press the screen it throws a rocket(which also has a body and a fixture) that the player can controlll touching the screen. My game also has ...
4
votes
1answer
269 views

LibGDX Box2D TileGame Efficiency

I am trying to implement Box2D into my top down tile game in LibGDX. Each world consists of a set of chunks, and each chunk is 16 tiles wide/long. The maximum/minimum chunks loaded at one time is 9 (a ...
0
votes
1answer
11 views

Libgdx: move img from one point to another?

I'm trying to make an image move towards another point. I only have the current X/Y and the destination X/Y + Speed. That's it. public void Draw(SpriteBatch batch, int goalX, int goalY){ destX = ...
0
votes
1answer
60 views

How to use Java 8 with Lib GDX in IntelliJ?

I have set the jdk to Java 8 and I have modified all the build.gradle files in my project to have sourceCompatibility = 1.8 instead of 1.6. My problem is that while it does work on Desktop it doesn't ...
1
vote
1answer
943 views

Libgdx, how do i get the translation and rotation of a node from a model instance?

I have a model instance of a character, and a model instance of a sword weapon. THe character has a node on his right hand so he can "carry" the sword. Right now I use this code so the sword's ...
1
vote
1answer
232 views

libGDX new TextureAtlas(filename) and new Texture(filename) drawing stale image data

I'm trying to draw an image using libgdx but no matter what I do, libgdx seems to insist on drawing a portion of an image I had loaded and used in an earlier game screen. In my current game screen ...
0
votes
1answer
122 views

How to zoom and scroll in libGdx?

I am trying to both A.) Pinch zoom my game scene and B.) Move (scroll) my game scene but I have not found many examples. I learn more by examples than by reading API documentation (although I am ...
0
votes
0answers
22 views

Libgdx tiled map collision scale problem

I followed Dermetfans tutorials on youtube to make a collision tile map for use in Libgdx and I think I have some scaling problems related to the camera. I'm loading the map and the bottom left corner ...
1
vote
3answers
67 views

Confused about using libGDX dispose()

Can anyone please help me to understand the proper use of the dispose(). Does dispose() get called automatically or do I have to make a call to it? In a game I'm writing, I use a texture atlas and ...
0
votes
1answer
32 views

libGDX : Paint And Remove Color From Actor with touchDragged

I created two-dimensional array of Button actor, then I added new ClickListener() { touchDragged } as the following code: buttons = new Button[3][3]; for (int row = 0; row < buttons.length; ...
1
vote
1answer
64 views

Libgdx: Check collisions in Stage among actors

My goal is to check collisions among the actors that are in the Stage. My question is: is it necessary to maintain a list for each type of actor I have? Doing that I get 3 problems, 2 bad design ...
1
vote
1answer
177 views

Rotating towards a point in Box2D

I'm using Box2d as my physics engine and I'm trying to solve what would normally be a simple problem but what has become a nightmare for me and preventing me from finishing my app. (6 months work) ...
3
votes
1answer
49 views

Scene2D Actor walking animation?

I used to extend my Player/Entity class with Sprite, that way I could create a walking animation using SetRegion and super(stilldown.getKeyFrame(0)); I've recently started porting everything over to ...
0
votes
1answer
64 views

Handling multiple input mapped to single in-game controls

I am trying to map multiple input types to single in-game controls using libGDX's InputProcessor and ControllerListener interfaces. Currently, I have created a single InputType interface which is ...
4
votes
2answers
179 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
1answer
13 views

Make a sprite jump to a certain direction in libGDX

I was wondering how you can make a sprite jump to a certain direction in libGDX just like the brick does in the famous mobile game "Amazing Brick' I want to make my sprite jump up a bit to the right ...
0
votes
1answer
188 views

LibGDX make an object rotate around something

I need to rotate and object, which should be a circle made up with a ShaderRender, around a specified point. In LibGDX there is a method or something which allow me to do this? If it doesn't exist how ...
1
vote
1answer
47 views

Circle to Polygon collision response

I'm working for collision response for my 2d game. Character is represented by circle and obstacles are represented by Polygons(in my example it would be rotated rectangle for simlification). The ...
0
votes
1answer
490 views

libgdx ActorGestureListener.pan() parameters not moving actor in smooth line

I override the pan method in ActorGestureListener to implement dragging actors in libgdx (scene2d). When I move individual pieces on a board they move smoothly, but when moving the whole board, the ...
3
votes
2answers
1k views

Matrix rotation wrong orientation LibGDX

I'm having a problem with matrix rotation in libgdx. I rotate it using the method matrix.rotate(Vector3 axis, float angle) but the rotation happens in the model orientation and I need it happens in ...
0
votes
2answers
44 views

Round position to center of current grid position

The title may not make sense, nor may the question - I'll try nevertheless. I'm attempting to make a game similar to The Powder Toy. Essentially, this is a physics simulation game, where the users ...
1
vote
1answer
64 views

Switch beetween Screen on LibGdx application

i have set main class like this: public class MyClass extends Game { MenuClass menuClass; ActionGame actionGame; @Override public void create() { menuClass = new MenuClass(this); ...
2
votes
1answer
5k views

Game Update in Libgdx

In libgdx, the game loop is the render() method. But why is that, and is there a way where I can make an update() method that is called 60 times a second? As in the update() method, I would add the ...