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

2
votes
1answer
53 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 ...
4
votes
1answer
156 views

Is there an optimal method to implement moving background?

I am trying to develop a little game using libGDX. We have a hero who jumps and world consist of dynamically created moving platforms in an auto side-scrolling manner. I wanted background to scroll at ...
1
vote
0answers
74 views

error after changing the app name

I have made a game in Libgdx(eclipse).I changed the name of the app inside the string.xml file.Now I have an error in AndroidManifest.xml. in this line: android:label="@string/app_name"‬ (line 12). ...
2
votes
1answer
348 views

How to draw a polygon with picture in libgdx?

I'm working around a simple rectangle game, It just split the rectangle in to a lot of polygon debris. I use Pixmap and Texture to draw the edges of each polygon. ... for (GraphEdge e: _edges) { ...
1
vote
1answer
61 views

how to add “tween-engine-api” to my ilbgdx game

I finished now my first game at LibGDX (I am using Eclipse). I run the game in the desktop launcher and it works. I now want to run my game on android and IOS. From some guides I have read ,I ...
1
vote
0answers
94 views

resize images in libgdx

I know how to set Image width and height using pixel coords. Is there a way to set relative coords? I want to deal with multiple screens. For example i have 1920x1080 screen size. And i have relative ...
0
votes
1answer
16 views

libgdx: 2nd var of myClass()'s values saving to/overriding 1st var of myClass()

I'm using libgdx with Eclipse. PROBLEM: In the class inputHandler I have a list of buttons, menuButtons, composed of 2 buttons: playButton and retryButton. They both belong to the class ...
1
vote
1answer
56 views

3D mesh culling issue, further faces showing through closer faces

I'm trying to render a generated mesh using libGDX which acts as a java wrapper for openGL. The issue i'm having can be seen in the screenshot below. The faces of the mesh that should be hidden by ...
2
votes
1answer
347 views

Libgdx Networking (http requests) - Login [duplicate]

I am new to Networking and Databases, but im trying to learn MySQL and HTTP Requests to create a user Login for a game. My goal is to let users create accounts and login to them etc (for Highscores ...
-1
votes
1answer
44 views

precedurally generate blob-like surface? [closed]

Just looking for some direction, I'm making a 2d top-down game and need to make some random shapes for an asteroid surface. I want to have so control so I can have not too-circle-ish but not ...
1
vote
1answer
179 views

Tween animation with Universal Tween Engine LIbGDX

Let me preface by saying that I'm new to libgdx... I have an animation that I'm currently drawing to the screen using: game.batch.draw(flyAnimation2.getKeyFrame(elapsedTime, true), 200,200,0, 0, ...
1
vote
1answer
113 views

Screenshot always returning as a white image on iOS using robovm and libgdx

I am trying to take a screenshot for sharing on social media. This code works on my Desktop project, but when I use it on iOS it always shows up as a white image, I am using the standard libgdx code ...
0
votes
2answers
64 views

score displaying system without using bitmap [closed]

how to make a score displaying system without using bitmap in libgdx. I making a fluppy bird remake somone can explaim me in details?
0
votes
1answer
31 views

Box2d java contact point reference changes after collision

I am trying to hold the contacts made during a collision in an array list. After I add n amount of contacts, when I try to retrieve them later on, they point to the last contact made in the world. ...
1
vote
0answers
100 views

Rotating, moving and scaling a mask in a shader

I want to rotate, move or scale a mask in a shader. But I have no clue to how perform these actions. My code: @Override public void create() { batch = new SpriteBatch(); background = new ...
1
vote
1answer
215 views

LibGdx Sound start to give an error after loading GameScreen multiple times

I have a LibGdx game, where the user taps on the screen, and a Sound will play. When the user taps on the screen, a texture will "fire" another texture as a missile, and can hit a target, when this ...
0
votes
2answers
101 views

LibGDX: Content appears stretched although I'm using a ScreenViewport

I just fixed another issue regarding the scaling inside a ScreenViewport. And yet another problem arises: If I'm understanding the wiki correctly, a ScreenViewport does not scale or stretch the ...
0
votes
0answers
22 views

LibGdx - Sound stops working after a while with error from SoundPool/AudioTrack [duplicate]

I have a LibGdx game, where the user taps on the screen, and a Sound should play. After a while, the Sound stops, and all other Sounds too, but it doesn't stop completely, it plays after a while ...
0
votes
1answer
227 views

LibGDX: Issue with unitScale for Tiled and Box2D

I've got the following: I use a TiledMap (loaded from a .tmx), each tile 32x32 pixels in size and generate the Box2D bodies for collision from the TiledMap's ObjectLayer. That all works fine, no ...
1
vote
1answer
106 views

How can I implement child objects that follow the movement of a parent?

I'm looking for a way to have a character, let's call it "root," with a number of other similar characters attached to it. Let's call them children. When the root changes position the children follow ...
0
votes
1answer
65 views

The import aurelienribon cannot be resolved

I've been having problems with using the Tween Engine by aurelien ribon for a Splash Screen for my 2d game. I'm using Eclipse and libgdx. I've tried rebuilding, clean...-ing, and refreshing. I've ...
0
votes
2answers
98 views

Why does Intersector.overlaps return false?

I am trying my hand at creating a simple game using libGDX. The idea is: We have a hero who jumps and world consist of dynamically created moving platforms in an auto side-scrolling manner. In order ...
0
votes
1answer
37 views

Error when initializing Stage

I made a new class that implements Screen, what I've seen from other people's code is that they create a constructor that takes a parameter of Game game. I did not created a constructor, I think ...
0
votes
1answer
197 views

Screen management: How to switch between screens

How can I switch between different screens that implement Screen?
0
votes
1answer
276 views

Match 3 game - Check for matches

I'm out of ideas and need help. So far I generate a board nicely using a flood fill algorithm and a 2d-array, I can also move tiles around the board. Each Tile knows its own row, column and ID ...
5
votes
1answer
108 views

Horizontal lines between vertices do not render

Good day, I am using LibGDX to try to render a mesh for a hexagon board. I can render the triangles, which is great, but I am having an issue rendering all of the line segments for the mesh and I ...
0
votes
1answer
124 views

How do I move an object with an accelerometer in libGDX?

I am working on a game which uses the accelerometer to move an object called "plane". I know how to add an accelerometer, but I can't get the plane to move. package com.wyvern.pp.states; import ...
0
votes
1answer
99 views

Crash when setting a new screen

In my almost finished game I want to set a new screen on game over. I got my game over method: private void gameOver(Label score) { for (Body body : worldBodies) { ...
1
vote
0answers
40 views

Java (libGDX) - Inheritance problems

I'm having some issues with inheritance for one of my libGDX projects, I'm making a game similar to (very stripped down) Terraria or Starbound and I am using the TiledMap to load the world, ...
2
votes
4answers
151 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 ...
4
votes
1answer
300 views

Why is libGDX's HexagonalTiledMapRenderer adding extra space?

Why are there large spaces between the hexes when rendered by HexagonalTiledMapRenderer? The tiles ARE black bordered, but that doesn't account for all the extra space. I was also able to get them ...
3
votes
1answer
148 views

Android TV game development

Anybody develop games for Android TV? Especially with libGDX? I would like to know what game controllers Android TV uses? And whether we can use libGDX to control the game controllers?
0
votes
0answers
93 views

Independent Column sizes in Scene2D Table in LibGDX

For my game's (mostly GUI based) UI i am using table from Scene2D in libGDX. I want independent column sizes in my table but first cell width is the width for all other rows in column. Is it possible ...
1
vote
1answer
52 views

dynamic body jumping out of water object

In my game I have my main object, a jetski, which will dive down into water, when the screen is touched. I managed to code the jetski diving down, with Box2d and some buoyancy forces. But when the ...
1
vote
2answers
37 views

applyForce as long as display is pressed

In my project I have my main character body. I want it to move down on the y-axis as long as the screen is pressed. I tried it with public boolean touchUp(int screenX, int screenY, int pointer, int ...
0
votes
1answer
123 views

How to rotate libGDX particle to face the direction of movement

I'm creating spark particle effect so I created simple horizontal spark texture. Here is what I currently have If I change rotation property, I get this But i want to rotate particle to face ...
0
votes
1answer
93 views

Black screen when launching on phone

I am coding a game in libgdx. While adding the background I used the html module to watch the results fast and easy on my computer. But when I try to see it on my phone I just get a black screen. My ...
1
vote
1answer
62 views

libGDX fileHandle cannot readString()

I have created a text file called "useraccounts.txt". All I want to do is to read the file using the filehandle class but I always get this exception: Exception in thread "LWJGL Application" ...
1
vote
1answer
143 views

2D grid based game merging boxes

Basically what i have at the moment is a tile based game with a grid containing a number of colored cells. this is what i've done so far The prinipal idea of the game is that the user has to ...
1
vote
2answers
56 views

Camera controll in Libgdx

I've a condition in my game where, I want my camera to follow the Player(its a body from Box2d) and in some not. This is the start screen of my game: Now, when i press a button(space) the player ...
0
votes
1answer
272 views

Stopping Actor tap/click event from propagating

I've been struggling with this for hours now and have read posts, docs and libgdx sources to better understand what's happening, but I still can't make any sense of this. I want to accomplish ...
0
votes
0answers
101 views

Scene2D: Dialog show with animations Sequence is also applied to the Dimming Background

I have issues with the dimmed Stage background when showing a Scene2D Dialog with Action Sequence (animations). The problem is that the animations are also applied to the dimming background and the ...
1
vote
1answer
26 views

Can't give my pictures the right location in libGDX

I have this code here sb.draw(title, (PPlane.WIDTH / 2) - (title.getWidth() / 2), (float) (PPlane.HEIGHT / 10)); sb.draw(playBtn, (PPlane.WIDTH / 2) - (playBtn.getWidth() / 2), PPlane.HEIGHT / 2); ...
4
votes
1answer
181 views

Dialog/event system in Java/libGDX

I hope that I'm posting this correctly as I'm new to the site, feel free to correct me if I'm in the wrong spot. As for my issue: I'm working on an 2D side-scrolling platformer game in libGDX, and ...
1
vote
1answer
43 views

How to draw a BitmapFont every user click

Im starting learning the libgdx framework and I want to "clone" some games. I know how to handle touch with if(Gdx.input.isTouched()) But how do I render new fonts every time user clicks on the ...
0
votes
0answers
19 views

DynamicBody diving into StaticBody

In my game I want a DynamicBody to dive down into a StaticBody. I set up both bodies. At the moment they are colliding. How can I get my DynamicBody to dive down? Is it going to work with this ...
1
vote
1answer
58 views

Polygons and actionlisteners Libgdx

I've been browsing these forums for a while now and I nearly always am able to find an answer without having to ask my own question! Such a great community! This is the first time I've been stumped ...
1
vote
1answer
115 views

LibGDX: How to detect remote button press for Android TV?

On Android TV, I need to be able to detect the remote control centre button to start the game. I tried: if (Gdx.input.justTouched() || Gdx.input.isKeyJustPressed(Input.Keys.SPACE) || ...
0
votes
1answer
34 views

Box2d Coordinate System

In the game I'm trying to code I got to have two bodies. One StaticBody and one DynamicBody. I want to have the DynamicBody on top of the StaticBody. Somehow all I get is this: Is it possible that ...
0
votes
3answers
77 views

libgdx(android) touchup triggers more than once?

I have a function I run inside the touchUp method but when I click with the mouse during emulation, it triggers my function multiple times. I don't think its an error with the called method itself ...