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

0
votes
0answers
5 views

Android Studio libgdx multiplayer

Does anyone know if it's possible to setup a multiplayer game using libgdx in Android Studio? I've been trying to convert my game to multiplayer using all kinds of tutorials on libgdx & ...
-1
votes
0answers
9 views

Libgdx Android pinch to zoom auto zoomed when touched

I am new in game Dev with LibGDX and I would start with easy implementation. I have issues in zooming (pinch to zoom), when I press again and I want to zoom again the picture returns in the start ...
0
votes
0answers
30 views

How to get GestureDetector to work?(Problem with GestureDetector class)

I am trying to write simple program which would get input from user by swiping in four capital directions. I'm extending GestureDetector.java from libGDX and overriding fling method, but no matter ...
0
votes
0answers
13 views

LIBGdx - Kryonet with an InetSocketAdresse

I'm trying to implement Kryonet in my game and i'm facing some trouble. Using the source from the code i develop my server like that : try { this.server = new Server(); ...
0
votes
0answers
13 views

LibGDX Android Unclickable buttons on Dialog

I'm using the libgdx for a simple pong game only for Android and I'm trying to show up a dialog when the back button is pressed. My activity implements Screen, InputProcessor and in the keyDown ...
0
votes
2answers
56 views

How would I create classes for each map tile instead of using a tmx? LibGdx

I am making a top down style game using LibGdx that I want to be randomly generated each new game load. I already have the algorithm to generate the array for what tile should be what. But i'm ...
0
votes
2answers
49 views

Java libgdx Game Screens and rendering tile map [on hold]

I'm working on a 2D tiled game with Java and libGDX. I'm having problems implementing gamescreens. I'm trying to set the screen to gameScreen and start rendering tiles, but I'm getting a nullpointer ...
0
votes
0answers
22 views

run animation one cycle when button is pressed in libgdx

I have been searching for a while now and i cant find how to run my animation a complete cycle when a button is pressed, the animation runs as long as the button is pressed but the animation takes a ...
0
votes
1answer
17 views

LibGDX full screen display mode and camera resize

I'm creating a simple 2D platformer and I have problem with my camera y position when I enter full screen mode. But first here's my code screenY = Gdx.graphics.getHeight(); public void ...
0
votes
1answer
24 views

How can I update a Stage-based HUD from another Stage's Actor in libGDX?

I feel like this is a simple problem, but I'm having issues finding the correct search terms. I have a Screen that includes two Stages. The first, stage, contains a number of objects deriving from ...
-2
votes
0answers
19 views

libGDX interface cannot be applied error

I would like to use interfaces in libGDX. I get an error in AndroidLauncher before compile. It says for this line: initialize(new MyGdxGame(actionResolverAndroid), config); .... cannot be ...
1
vote
0answers
19 views

Import Unity 2D objects in Libgdx

I'm using Libgdx to do some simple home projects. I'm trying to make a simple 2D game with Box2d using R.U.B.E as editor. I create a 2d terrain in R.U.B.E now I want to create the terrain texture. I ...
0
votes
0answers
249 views
+50

Body gets recreated

In my game you have the Square, which is the player, and the Circle which is the enemy, the player carries a weapon, when shooting the game calculates where to place the bullet in relation to the ...
0
votes
1answer
39 views

Implementing Spine animations in Libgdx

I've been searching a lot for a guide on how to implement 2D animations exported from Spine to Libgdx, but all I could find was outdated tutorials and source codes. I can handle basic Libgdx but Spine ...
0
votes
0answers
22 views

error in post a screen shot of game scores with Android Intent in LIbgdx game

I want to post a screen shot of my game on social apps. I have developed this game using Libgdx framework. I have created an interface in Core class. Here is its Intent share specific code. ...
5
votes
2answers
75 views

Body lost a velocity component when hitting a wall

I am creating a Breakout game using Box2D (of LibGdx if anyone interest). Everything works well until when the ball hits the wall when moving with a very small angle. Please look at the image for ...
0
votes
1answer
39 views

box2d not centered in sprite [duplicate]

I am trying to create a bounding box for my sprite using box2d, but the box is being created at the wrong spot. I followed a tutorial on the wiki using this code BodyDef bodyDef1 = new BodyDef(); ...
0
votes
1answer
37 views

Libgdx distorted texture size

I'm just starting to learn LibGDX and have been having some troubles getting my world size to match with my texture size and box2d bodies. I have a texture 64x64 that I am trying to display but it ...
0
votes
1answer
31 views

LibGDX particle emitter rotation

I have a libGDX game, in which I'd like to make some ice breath like effect using particles. So far we made a cone like effect. I can obtain and render it on the screen with this. ...
0
votes
1answer
47 views

Libgdx - Jumping, What am i doing wrong?

I really can't work out whats wrong with my code. I have an input listener for gestures, when I Swipe the position goes up on the y axis fine but he doesn't come back down, if with Gravity added. I'll ...
0
votes
0answers
20 views

Shaperenderer not showing any shapes

I'm trying to use the shape renderer in LibGdx, but I don't see anything. I followed the docs as well, but nothing appears. Is there something wrong with my setup? public class MyGame extends ...
2
votes
1answer
102 views

How do I draw a circular portion of a texture within LibGDX using an OpenGL ES shader?

What is the simplest way to implement a shader to draw a circular portion of a full screen texture where the circle is dynamically resized as part of an animation using LibGDX? Is a shader even the ...
4
votes
1answer
123 views

Image edges are distorted inside game

I dont know how to explain this, so I will use images to describe my problem. The image I made using InkScape: What it looks like in-game (ignore the runner): As you can see the edges are not ...
2
votes
1answer
25 views

How to draw portion of a sprite in libGDX

Let's say i have a sprite like this: and i want to draw the lower portion of it, only the yellow color.. Initially the sprite has dimensions 10x10, i want it to be drawn 10x3 Do i have to ...
0
votes
0answers
38 views

Libgdx trying to get reflection of ball with plane in 3D space

I just cannot seem to get the right reflection result. Have tried reordering the operations but none seem to work. Hoping someone might tell me what I am doing wrong. Trying to accomplish the formula ...
0
votes
1answer
45 views

Pan camera within bounds of large image

I have a camera that I pan around a large image which works fine, however when I reach the end of the image I can keep panning on and on, forver. I have looked everywhere for an answer on how to ...
1
vote
2answers
61 views

LibGDX: Easy way to draw partial sprites

I am surely overlooking something, but is there an easy to draw for example only half a sprite in LibGDX? I originally thought I could do this with setBounds() but this distorts the sprite.
0
votes
2answers
62 views

GestureDetection Issues - How do I make my Actor jump on Swipe?

I've been trying to solve this for hours now, In theory I totally understand how the GestureDetector works but I'm trying to integrate it with the Libgdx SuperJumper Tutorial (for now). Here: ...
0
votes
3answers
57 views

Why should i set glClearColor and setProjectionMatrix in render method many time in LibGDX?

import com.badlogic.gdx.Game; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class MyGame extends Game { public OrthographicCamera ...
1
vote
0answers
37 views

Why do I get glitchy graphics when drawing scene with scene2D?

I'm trying to display a simple text for a menu UI using scene2D, but for some reason nothing is being displayed here. The screen displays pure black. public class ScreenMenu implements Screen { ...
2
votes
1answer
32 views

Java Libgdx: How do you add cells to a TiledMap?

I'm trying to make a Side-Scrolling game that will allow you to place/remove tiles. I'm using the TileMap Editor to render the custom Tilemap but is there any way to add tiles? I have it where I can ...
2
votes
1answer
37 views

Libgdx, tiled map - how to reload layer?

In the simple platform game I'm making, when player collects coin, its cell is set to null. Is it possible to recover all cells from layer "coins" after player dies? I have tried multiple things but ...
1
vote
2answers
40 views

ScrollPane scrolling velocity

I'm working with a custom ScrollPane, but I can't find how to change the velocity of scrolling (not on fling action). Can anybody tell me how reduce scrolling velocity on calling setScrollY() or ...
1
vote
1answer
39 views

Suddenly cant run project in libgdx anymore

Ok so in a sudden case of nostalgia, I switched my eclipse workplace from my working libgdx projects to an older one. After looking through my old stuff I had some problems switching it back, since I ...
1
vote
1answer
35 views

Checking if Body is surrounded by other Bodies

I'm trying to make a game like Rampart as practice. I have gotten to the point where I want to check if the castle is surrounded by walls and decide whether to fill in the area and continue the game, ...
2
votes
1answer
54 views

unable to use two gestures simultaneously

I have a class implementing gesture listener in libgdx. I want to use longpress gesture in one half of the screen and fling gesture in other part of the screen simultaneously. public class ...
1
vote
1answer
68 views

How to move objects in any direction by swiping with libgdx android game development

first of, I'm new to android game development so I don't know all the classes and dictionaries within android and libgdx. I'm actually following a game development tutorial for the first time ...
0
votes
0answers
42 views

(LibGDX/JAVA) How can I get a rectangle to rotate with this pendulum so I can start detecting collisions?

One of the objects in my game is a pendulum that swings in a semi-circle. This is done by having an update() method like this: public void update() { angleAcceleration = +1.81 / length * ...
0
votes
1answer
61 views

How to add a callback to addAction in scene2d

Sorry if this is a newbie question, I'm still learning libgdx. I'm using scene2d and I am trying to fade a tooltip into my scene and fade it out after 4.5 seconds. Everything is working in my code ...
0
votes
0answers
17 views

Connect lightsource with object in Libgdx

I want to make an minimalistic highway chase game in LibGDX, but I have a question. Can I attach a source light to an object so gravity will affect the source light, by pulling it down? One solution ...
0
votes
0answers
47 views

Sprites not being rendered on screen change - Android Libgdx

In my game over screen for my Libgdx Android game I've the following code which starts a new game upon a screen touch. if(Gdx.input.isTouched()) { ScreenManager.setScreen(new ...
1
vote
2answers
51 views

LibGDX Android project in IntelliJ

I've created a LibGDX project. I imported the build.gradle. The core and desktop modules are imported successfully, but the android not. So I add the content roots. The project compiles, I could build ...
0
votes
1answer
58 views

Game lags when my player collides with a specific object (solution known, unsure how to implement)

I'm developing a game in Android using LibGDX (although this is more of a JAVA problem than an engine problem). My aim is to have my player bounce off one spring onto another that will eventually take ...
1
vote
0answers
35 views

LibGDX Tiled Map - how to get embedded objects

I am using LibGDX to learn Game Development. I have reached the phase I am learning to use Tiled Maps. In Tiled map editor, there is a feature where we can pick a tile in the tile set, go to View -> ...
1
vote
1answer
69 views

Grayscale color mode texture not rendering in libGDX

I am about to develop a game completely in shades of grey using libGDX and just for testing purposes, i created two textures in photoshop: 2048 x 2048 plain white png image with RGB color mode of ...
-1
votes
1answer
26 views

libGDX's 2D particle editor launching incorrectly

What's going on? Here's my process: I first right-click the referenced library for gdx-tools.jar in Eclipse: I then search for the particle-editor class: It opens successfully, but half of the ...
1
vote
1answer
78 views

Is there any case to mix Android UI with LibGDX?

my question is about creating "non-playable" screens in games with the help of native android tools. For example, I have an Android LibGDX game (singleplatform), what should I use to provide start ...
0
votes
0answers
16 views

Libgdx - How to change GestureListener pan finger sensibility?

I implemented GestureListener in my Overlap2dStage to pan the camera when the player drags its finger over the screen. But I also have some actors that extend InputAdapter to detect when the user ...
1
vote
1answer
49 views

(Java) Trying to animate an arraylist of coins with a (working) animation class

I have a coin class which takes in an integer numOfCoinsand an enum LayoutType, which can be linear or curved. A linear layout displays the coins in a straight line one after the other - we'll work ...
1
vote
0answers
47 views

Using Box2D in LibGDX, is there a reason a fixture set to be a sensor would only -sometimes- detect a collision?

I am working on a 2D game in LibGDX. Currently, I am testing interactions between a player's weapon and enemies - in particular, a sword and an enemy monster. The player has a hurtbox and the sword ...