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

0
votes
2answers
115 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 ...
1
vote
2answers
110 views

OpenGL — Better to switch out material or shader for changing object colors?

I'm fairly new to shaders and OpenGL so bare with me please, I just want to make sure I'm doing it correctly! Now I'm using LibGDX in order to create a simple 3d diagram for my company. I have a few ...
3
votes
4answers
3k views

libgdx - collision detection with tiled map java

currently, I am working on a 2d rpg game which is similar to final fantasy 1-4. I can load up a tiled map and the sprite can walk freely on the map. However, I will like to create a wall for it to ...
1
vote
3answers
228 views

libGDX best way to do Game States

I'm making a JRPG in libGDX, and I'm working with Screens. I have a main Screen called GameScreen, a screen for battles called BattleScreen and I want to make a screen for managing party members and ...
1
vote
2answers
111 views

Object orbiting a 3d sphere

I'm developing in libgdx java/android but not using any high-level environment like Unity. I have a sphere at [0,0,0], with a PerspectiveCamera looking at it. Through the main game loop I have ...
0
votes
2answers
68 views

Delaying certain actions/functions in libgdx using Timer?

Hello I am trying to delay a part of the processes in my game, but it happend that I use one of my variables in an inner class so I have to make it final, but by making it final I can't assign new ...
3
votes
2answers
78 views

Write error log on crash in libGDX?

I've been having problems building my game. I've built it successfully before, until I added the LuaJava.dll and LuaJava.jar files (so I can use Lua in my game). Now, it just briefly opens with black ...
0
votes
1answer
65 views

FollowPath steering behavior

I'm having a problem with AI movement in my top-down game. AI builds path and than moves using libgdx FollowPath (this problem is still actual) steering behavior. I have some solutions, but can't ...
2
votes
4answers
145 views

Rendering Tic Tac Toe Cross and Circle in libGDX [closed]

I am new in LibGDX. For learning purpose, I am creating TicTacToe and I spent two days to figure out what went wrong with rendering the cross and circle. Whenever I click on the cell, the cross and ...
6
votes
1answer
376 views

How can I rumble/vibrate my controller with libGDX?

The com.badlogic.gdx.controllers.Controllers API only supports getting the input data (which works fine). Is there a way to make my controller rumble/vibrate, possibly using some other classes? I ...
0
votes
0answers
27 views

Libgdx Box2D - Object not showing up

I am trying to put a sprite into my b2d-world. But for some reason, it is not showing up. I've already checked the camera settings, they are defenetly correct. Then I came to the point to check the ...
3
votes
1answer
184 views

How to implement rotating rectangle around circle in libGDX Box2D?

I want to implement rotating rectangle around cicrle in such way, that circle has no rotation, and rectangle has, and I could myself control rotation of this rectangle (I mean set its angular ...
3
votes
1answer
125 views

Resolving collisions with float precision errors

I'm facing a problem when I try to resolve the collision between two units using floats as positions of the units in my game. I am detecting the collisions using the SweptAABB algorithm and if there ...
1
vote
1answer
34 views

How can I handle markup sequences in a libGDX TypeWriter implementation?

I've implemented my own TypeWriter for text that looks like this public static String GetWords(String text, float wordCount) { float words = wordCount; // loop through each character in text ...
2
votes
2answers
40 views

How can I automatically fit elements in libGDX layouts?

Recently I wanted to use libGDX's Table to show four buttons. But my table doesn't fit on the stage: Here is the code I used: table.add(new GameButton("1")); table.add(new GameButton("2")); ...
0
votes
3answers
213 views

making an object follow a path libgdx [duplicate]

I am making a game that has objects that shoot other objects. I need the enemies to follow a path. The easiest way I can think of doing this is by having an array of coordinates and they move between ...
0
votes
1answer
67 views

Libgdx - when / how to save data

I'm making a simple 2D game in libgdx, and now I'm at the point where I have to save data. I already have a mechanism to save the data itself. The problem is that I don't know when/where the procedure ...
2
votes
1answer
71 views

How to set indent spacing of a tree in libGDX scene2d?

I've been trying to create a customized UI using scene2d library in libGDX. However I am having troubles as I'm trying to set a custom indent spacing on my Tree object. I have tried to search for the ...
-1
votes
2answers
269 views

Libgdx coordinate system

I just started with libgdx and I'm still figuring out how the coordinate system work.The code below would draw the image at [0,0] without the Orthographic camera What I can't understand is why the ...
1
vote
1answer
211 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 ...
2
votes
1answer
43 views

Call function via ContactListener

I've been creating a game on my own in LIBGDX, BOX2D and there' s a problem I can' t solve. When two World bodies collide, method "beginContact" is called in MyContactListener class that implements ...
1
vote
1answer
197 views

Clearing a libGDX pixmap

Is there a way to clear a libGDX Pixmap? Or is the only way to dispose it and create a brand new Pixmap?
0
votes
0answers
52 views

Rendering BOX2D shapes with LIBGDX

I have been creating a game on my own and I need a little help to begin with graphics. I haven' t found much in the internet about this topic, so I came here. Right now I've got a chainshape that i'm ...
0
votes
2answers
83 views

Libgdx change to other screen and dispose current one

I am trying to switch to a GameScreen when the LinearVelocity of a Box2D - Object is x = 0. If it is so, I am using the setScreen() - Method by calling the main class. This works perfekt, but when ...
1
vote
0answers
72 views

Point Light shows black box & rect (PointLight not working) - libgdx 3D

I am creating a 3d scene currently a box and rect, and trying to enable lighting. When i create a PointLight and add it to Environment everything turns to black color? all i want to do is ...
0
votes
0answers
45 views

Is it possible to use a Unity 3d Model with libGDX?

Can I use a 3d model like https://www.assetstore.unity3d.com/en/#!/content/36951 in a libGDX 3d game?
5
votes
1answer
102 views

Libgdx: how does dispose() work?

My game uses a lot of images, for the over-world, battle screens, chats, etc. I'm really meticulous when it comes to memory management, and I've noticed that even though I dispose every image when I ...
0
votes
0answers
29 views

Creating tunnel of points in LIBGDX

I have been wandering in the Internet lately to find the best possible solution for creating a 2d tunnel/cave in my game in LIBGDX. My game in short: One player can control a shape in tunnel, the ...
0
votes
0answers
34 views

LibGDX: drag and drop in a vertical group

I need to mode with a drag and drop a cell/row in a vertical group and change its position, before or after another cell/row. Is there something that can help me to implement this? Thankyou
3
votes
1answer
151 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, ...
2
votes
1answer
101 views

Screen not rendering after restarting game

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 copy of the question Sprites not being rendered on ...
0
votes
1answer
177 views

Libgdx switching between screens without losing Information

I've been having issues with Screens, as I want to switch between the main game screen, the battle screen and the ingame menu screen (JRPG). The problem is that I have initialised all the information ...
0
votes
0answers
35 views

LibGDX: Skin and scaling problems

I'm trying to use Skins with TextButtons. However I'm having an issue where the TextureRegions of the Skin are NOT being scaled down to the tablesize. This is leading to an issue like in this image: ...
1
vote
2answers
167 views

Async loading in libGDX to set the screen

I would like to bring up a loading screen, for this would make the load async. How can I do this? I looked on the libGDX website but I do not understand very well, maybe because of my poor English. ...
3
votes
2answers
4k views

How do I move the camera sideways in Libgdx?

I want to move the camera sideways (strafe). I had the following in mind, but it doesn't look like there are standard methods to achieve this in Libgdx. If I want to move the camera sideways by x, I ...
4
votes
2answers
2k views

LibGDX Game vs ApplicationAdapter

When I create a new LibGDX project the main class of Core project extends ApplicationAdapter. Here is how it looks like. package com.marimba.apptest; import com.badlogic.gdx.ApplicationAdapter; ...
20
votes
3answers
7k views

Play videos with LibGDX

Is there a way to play videos with LibGDX? I want to put a video as my splash screen in Android, but I dont want to use the Android SDK, because I am using LibGDX and I am almost finished :/
4
votes
1answer
358 views

How do I save which NPCs the player has talked to?

I have built a save system that saves the players name, x and y location, map and the direction they are looking at in JSON. { data: [ { x: 400 y: 424 d: UP name: ...
1
vote
2answers
189 views

Libgdx: If Rectangle overlaps anything?

I've written a code that allows me to talk with an NPC. This works as long as there is only 1 NPC on the map. I'll explain why. public void getNPCCollision(){ for (int i = players.size() - 1; i ...
1
vote
1answer
104 views

Is it possible to use Android Libraries in LIBGDX?

I want to make an android application game that uses both android API like Location, even Google Maps API and also use Libgdx framework as well. Is this possible? I noticed there's an Android and a ...
5
votes
2answers
6k views

Change alpha to a Frame in libgdx

I have this batch.draw(currentFrame, x, y, this.parent.originX, this.parent.originY, this.parent.width, this.parent.height, this.scaleX, this.scaleY,this.rotation); I want to apply the alpha that ...
0
votes
2answers
2k views

Libgdx actor bounds are wrong

The Actor's boundaries are not centered at the ButtonText but I used the setBounds() method. The higher the Y position is, the less centered is the boundary. The weird thing is that i only created ...
-2
votes
1answer
129 views

Libgdx incredibly high RAM usage! [closed]

Alright so I'm new to Libgdx and Game programming in general, and I've got a huge problem. If I leave my game on, it will start to eat memory, pretty fast at that, until it reaches a point my PC ...
0
votes
1answer
75 views

LibGDX hexagonal tilemap getting adjacent tiles

How do I get all adjacent tiles to a hexagonal tile, my tile map is using a staggered co ordinate system with an odd stagger index and I am using libgdx java. if (x % 2 == 0) { hexAdj[0] ...
0
votes
0answers
22 views

Generating hexagonal tilemap in libGDX

How would I go about generating a hexagonal tilemap in Libgdx? My idea before was to just use a prebuilt tilemap and then change tiles on it but I'm having problems with the hexagonal co ordinate ...
0
votes
0answers
78 views

LibGDX: open android camera

I need help, I can't find a solution to open camera device in my libgdx app. I'm developing it only in Android for now but I have this issue. I need only to open the preview view, no snap picture o ...
0
votes
0answers
10 views

animation of an Actor in libgdx crashes on iphone

I am using a class found here on stackover for the animation of the actors , but I crash on the physical device class AnimatedImage.java: public class AnimatedImage extends Image { protected ...
0
votes
2answers
52 views

libgdx tiledmap rendering optimazation [closed]

I'm new to game development can anyone show me how to render tiles which were only seen by the camera I cant seem to find straight answer in google. The game is in 2D and im using tiled
2
votes
1answer
67 views

Referencing individual cells of a tilemap and changing texture

I have a tilemap and am trying to proceduraly generate islands on it by changing the texture of the tiles and marking it as land ( I want to do this without texture atlas for now). How do you change ...
0
votes
0answers
48 views

SpriteBatch draw does not work on iOS - LibGdx

I have a small problem , in practice if I batch.draw ( ... ) ; It does not work on iOS with robovm . my code.: on the crete() method: texture = new Texture(Gdx.files.internal("background.jpg")); ...