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

-2
votes
0answers
14 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
15 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
1answer
61 views

Body isn't moving even even though linear velocity isn't 0

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
0answers
21 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
20 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. ...
3
votes
2answers
57 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
37 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
30 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
25 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
45 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
24 views

Trying to get OOP working with libgdx [closed]

I'm trying to use this player class for my entity stystem, but rendering isn't working right. I'm trying to have each class render on it's own by calling entity.render(); in my core application class. ...
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
82 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
117 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
24 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
32 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
33 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
59 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
59 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
51 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
36 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
30 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
34 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
37 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
34 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
33 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
53 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
59 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
39 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
56 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
16 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
43 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
45 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
46 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
29 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
60 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
25 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
73 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
46 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
45 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 ...
1
vote
1answer
170 views

How do I reverse this function?

I'm working on an isometric tile rendering engine and I need to reverse a function I used to translate the Cartesian coordinates into isometric coordinates. I've already written a function for this, ...
1
vote
1answer
38 views

LibGDX font issues

I've started creating a small project for the store with LibGDX. So far I only tested on PC, and everything went well. I'm using the gdx-smart-font library for font rendering. The fonts are looking ...
0
votes
1answer
54 views

LibGdx Table not firing touch events

I can easily add listeners to the actors within a table, and they will fire events, but if I want an entire to table to have 1 listener and do not care to have differentiated effects depending on ...
0
votes
1answer
30 views

LibGdx: How to check if VSync is enabled

I am just about finished my options screen, the only thing I need is some way of detecting if Vsync is enabled or not. I'm using LibGdx 1.5. I have tried to find an access to wglSwapIntervals, but ...
0
votes
0answers
49 views

Dijkstra Pathfinding in Libgdx, some minor problems

I'm having some problems with my Dijkstra implementation in Libgdx. I understand that there are already AI libraries that can probably do this much simplier but this is a school assignment so i'm ...
0
votes
0answers
55 views

player sprite hidden after using a stage (scene2d library)

What i'am doing is showing a tiledmap on the full screen , and it works fine. The character moves perfectly and the camera too. What i want is : Showing some text or imageButton over the map like ...
0
votes
2answers
62 views

Is using Game in libGDX for more than just switching screens a bad practice

I'm the process of refactoring the prototype of my game to use multiple screens using the Game - Screens model. I found some information (I think in more than one place) that the Game class should be ...
1
vote
1answer
38 views

OrthographicCamera and viewport not giving expected effect

I recently asked a question about this area that I think was too broad, so I will try a new approach. I have the following code I am experimenting with: batch = new SpriteBatch(); ...
0
votes
0answers
21 views

How to resize animation in libgdx?

I want to draw an animation, the size of each frame is 500x500px but when I try to resize, the animation seems to rotate... Here the code to load frames and create animation: Texture fireSheet = ...