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
0answers
5 views

Libgdx unable to enter input in TextFields

Hello I am trying to make login screen for my game, I use TextField's. 1. I am not satisfied with how they look I want it to look like this but simpler - basically to have a white field next to the ...
0
votes
0answers
14 views

ChainShape in Box2D

I recently began to learn libgdx and I am stuck at a problem with the CainShape of Box2D. My first goal is to simply create a box with a ChainShape. In order to achieve that, I added four Vector2 ...
0
votes
0answers
12 views

Cant write/read to/from external storage with LibGDX

My create method looks like this: @Override public void create () { batch = new SpriteBatch(); FileHandle file = Gdx.files.external("file.txt"); file.writeString("My god, it's full of ...
1
vote
0answers
8 views

LibGDX Box2D texture on dynamic generated body

I'm creating a game that is similar to hill climb racing. I've generated the ground and now I want to add texture to the ground. Here is a screenshot of a game Here is my code (I create ground using ...
2
votes
2answers
91 views

Android libGDX FreeTypeFontGenerator exception

I am working on a libGDX project for Android. Since I added the following code, running the game on my Android phone produces an exception: final FreeTypeFontGenerator generator = new ...
0
votes
0answers
8 views

Libgdx moving a body sequence

How can I move a body (box2d) to different points in an order. Like first it moves to 100,200 then to 200, 450 and so on? I've tried actions(and actor) but I can't get the point where the body is ...
0
votes
1answer
41 views

Libgdx Megaman Engine

This is my first time posting here. Through the tutorials and videos I can find regarding developing games using libgdx. I thought I would start with something that was relatively simplistic, a ...
0
votes
0answers
12 views

How to verify POST data is sent from Android app with correct SHA1 signature?

Recently my game has been hacked and one user submitted an impossible score to the server. The score was submitted with a verified checksum, and correct data. I'm convinced that the user must have ...
0
votes
0answers
6 views

Waiting for scene2d action to be done?

I am trying to make the enemies in my turnbased combat game to do their moves. As it is right now, they will only move one step, but it will cost them 3 action points each. I think it might be because ...
1
vote
1answer
66 views

LibBDX create a tail when the object is moved

I am looking for a way to implement in my game a kind of shadow/tail which will be displayed after the object is moved. Should I use animation? If yes how? Here an example:
3
votes
0answers
61 views

Is it possible to use OpenCL in libgdx?

Been looking for a way to implement some OpenCL stuff in my libgdx project. It's possible via LWJGL which libgdx is based on, but it's only for the Desktop environment. Would like to have it cross ...
0
votes
1answer
26 views

libgdx: SpriteBatch and ShapeRenderer projection wrong

I'm using LibGDX and the SpriteBatch and ShapeRenderer are having a perspective problem or something... When I draw something with both (code below), the planet texture is smaller than it should be. I ...
0
votes
1answer
23 views

LibGDX: creating actor conformed by other actors

I am making my custom actor class, made up by 3 actors(oneProgressBar, one Label and one TextButton), because I will be using this many times, so it's not a good idea to create 3 of that actors when I ...
1
vote
1answer
63 views

Change screen from main menu to game

I'd like to know how I can change the screen from the Main Menu to the Game itself but im having quite the trouble and I would appreciate the help. What I want to do is when I press btn.Play it ...
0
votes
0answers
14 views

libgdx box2d car wheel circle collision with ground

I'm creating game similar to hill climb racing. I have created car (which is basically polygon with two circles) and ground generated by sinus. Now here is the problem: when my car try to climb in ...
0
votes
1answer
14 views

Libgdx, Gradle, android package naming problem

I'm upgrading my libgdx project to make use of all the new Gradle stuff. However I changed the package namespace from the default generated by gdx-setup but that hasn't worked: when I debug to my ...
0
votes
2answers
28 views

Libgdx AtlasTmxMapLoader with multiple tilsets

I am working on a Libgdx game which loads Tiled maps. The current map I am working on makes use of two tilesets, one for shadow/light and another for terrain and buildings. The general process I do, ...
0
votes
1answer
32 views

Libgdx rotate sprite with collision

Im making a game where I have an object in the center of the screen and then balls come out from the sides of the screen. When you touch the screen the object rotates 90 degrees clockwise and it has ...
0
votes
3answers
73 views

How To generate spiky terrain in 2D?

I am learning game design, and wanted to know how one can automatically generate spiky terrain (something like this: Cavernaut, notice, the terrain at the sides?). I have heard about midpoint ...
1
vote
1answer
92 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
1answer
29 views

LibGDX - How to export a texture as a .png onto, say, the desktop

I'm making a game in which I need to export a texture which the user has edited as a .png into a specified location. I'd like it if I could have the default saving window thing (like on other apps ...
0
votes
1answer
13 views

Having trouble going from the menu I created w/ Android normally to my LibGDX game file

So I wanted to use Android Studio to create the menu for my game so I created a button with an onClick method that included the Intent i and startActivity(i) but when I clicked the button the app ...
2
votes
2answers
88 views

create ipa without RoboVM in a project libgdx

I am creating an application with libgdx , and I wish I could produce an IPA without using RoboVM , because since version 1.9 became a fee . I saw on the original documentation that you can do with ...
2
votes
2answers
450 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
1answer
23 views

Libgdx Box2D random positions and intervals falling bodies

I need to make that objects fall from the top of the screen random intervals and positions. Here's my code where I create lot of objects and add them to ArrayList private void createBalls() { ...
0
votes
2answers
3k views

SpriteBatch being drawn outside of Stage?

Currently working on my first game, though running into some problems with libgx and screen aspect ratio. What I have is a Stage which contains things like menu buttons etc, and the rest of the game ...
1
vote
1answer
131 views

Too many if statements cause lag? [closed]

I am trying to make a vertical scroller game with collision tiles on both sides. I'm using Libgdx and android studio. The problem is that i have made every tile as an object with a rectangle for ...
1
vote
1answer
91 views

How to detect if two sprites are being touched at the same time?

I tried this: if(spr.getBoundingRectangles.contain(x,y)){ //do this } but how to detect if the other sprite is touched by the second pointer? Then I created two Vector3 for the pointer ...
0
votes
0answers
13 views

Creating & loading animation from one class in libGDX

i'm new to libgdx and i wonder if i can create all the animation for my game in just one class so i can just call it to my main game screen class,if it is possible can someone teach me how to do this? ...
3
votes
1answer
199 views

LibGDX - Can't read .ttf file when running Android configuration

when running or debugging my game on android device, i get this error in the logcat: com.badlogic.gdx.utils.GdxRuntimeException: Error reading file: data/fonts/myFont.ttf (Internal) which is ...
0
votes
0answers
19 views

Libgdx tiled map not showing

I'm using a HashMap structure to store and load my maps made in tiled. Currently I have two and I am able to go from mapOne to mapTwo with no problems. But when I go from mapTwo to mapOne, mapOne ...
1
vote
2answers
230 views

Accelerometer problems

When I hit an object, my Fighter is supposed to fall to the Ground. BUT, because of the Accelerometer, i can still move it up and down eventhough it died. The Scroller on the x-Axis though stops. ...
1
vote
1answer
156 views

LibGDX drawing portion of tmx map

I am trying to make a tile based game in LibGDX and I have run into some problem. In earlier versions of LibGDX you were able to draw a certain section of a .tmx map instead of a whole and even a ...
0
votes
1answer
254 views

Mouse coordinate conversion Libgdx

I have a camera: //Map is a my object that wrapper of TiledMap class In the create method: this.renderer=new OrthogonalTiledMapRenderer(this.map.getMap(); this.camera=new OrthographicCamera(); ...
4
votes
2answers
236 views

Smooth 1D terrain generation

So I'm pretty happy with my terrain, and the progress on my game. I just want to figure out why the terrain is so steep sometimes. Right now to generate my random seed I use this: seed = ...
0
votes
1answer
57 views

Convert transform from world to local space

I have a hierarchical node system. Given a world space transform, I need to obtain the transform for a specific node in local space. My Node class has the following method. public void ...
1
vote
1answer
245 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 ...
3
votes
1answer
58 views

LibGDX: Is it necessary to set a stage as an input processor when creating a touchpad?

I mean, I've been searching it, they always use set a stage as an input processor after they had added the Touchpadto the Stage because it extends from Actor indireclty(it extends from Widget that ...
0
votes
1answer
65 views

Map coordinates to camera coordinates

I have a tiled map which is 3 times higher than camera. When I press on a tile, I want an actor on that tile to show up. This works if camera is not moved. If I move camera a little bit up, so the ...
1
vote
1answer
25 views

Adding an InputListener to a Group

I'm trying to detect when a Group actor (my "slot") on my stage is clicked by add an InputerListener to the group. I've added the stage to my InputMultiplexer, but when I click on the actor, nothing ...
1
vote
1answer
31 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
38 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
758 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
44 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
26 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
77 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
134 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
208 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
41 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 ...