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

1
vote
0answers
489 views

Resize the Texture Region (parallax background) to fit my screen size in libgdx

I am using libgdx to make a running game. I am using vertical parallax background. I have successfully implemented parallax background many times. But for this game, I want my Texture region to fit my ...
0
votes
0answers
64 views

Make LibGDX game responsive to different phone screen sizes?

I've been experimenting with small games to learn design concepts, LibGDX, and Box2D. I am wondering how you would implement "responsiveness," so to say. For example, this is the rendering part of my ...
-1
votes
3answers
93 views

Shooting based off mouse position [duplicate]

I'm trying to shoot bullets where the mouse is aiming using one image as a test. I'm trying to get the mechanics like this I have some kind of algorithm to handle that but the results arn't too ...
1
vote
1answer
143 views

Libgdx stage rendering issues

I'm using scene2d for the first time, and I can't get anything to draw EXCEPT the stage ui. Say I have my ui on top of my game screen: uiStage.act(): batch.begin(); gameSprite.draw(batch); //does not ...
0
votes
1answer
69 views

Ball bouncing with box2d in libgdx

I just started using Box2d and libgdx. I followed this tutorial, https://github.com/libgdx/libgdx/wiki/Box2d And a ball would bounce if I run the following code I took from the tutorial. // ...omit ...
2
votes
3answers
899 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 ...
0
votes
4answers
6k views

How to rotate a sprite on circle in android using Libgdx

Dear Fellow Game Developers i am newbie to Android Game Development,i like to know how we can develop a sprite rotate in circle on android,with help of libgdx, i do have a image in assets ...
2
votes
1answer
80 views

Daily Unlock in LibGDX

I am trying to make a game that is a collection of mini games. The mini games will unlock daily. There are story for each day. And the story cannot be repeated so for example the player start playing ...
0
votes
1answer
41 views

LibGDX ShapeRenderer rotated

I'm having a weird problem with the LibGDX ShapeRenderer where it draws everything rotated. Here are some images to show you what i mean: This is what it looks like in Tiled(Map Editor): This is ...
0
votes
1answer
40 views

Setting bounds to a label in libgdx

textStyle = new LabelStyle(); textStyle.font = font; textStyle.fontColor=Color.GREEN; EnterTextCasheir= new Label("",textStyle); EnterTextCasheir.setBounds(AssetsHelper.convertWidth(158), ...
1
vote
2answers
60 views

Using libraries in libgdx

This is the first time I'm using libgdx and I've got one problem. I am confused by the web of dependencies and the number of projects and I'm not sure how and mostly where to add a third party library ...
0
votes
2answers
114 views

libgdx - handling battery warning

I want to pause my game when the battery warning on Android pops up. How do I do this? I have a method that pauses the game but how do I call it when the battery warning pops up?
0
votes
2answers
517 views

How to get width and height from a body in box2d?

I am working on a game in Libgdx framework. I have to get width and height from a body in box2d. is their any way to get width an d height from a body in box2d??
1
vote
1answer
68 views

Timer.schedule(task, 0, 100) never fires

I added some code using java.util.Timer to execute my spawnMonster function every 100ms. It worked, until I tried instantiating images in it -- since it doesn't run on the libGDX core thread, there's ...
0
votes
0answers
47 views

Creating a Wave Motion(ZigZag) on Projectile Motion in LibGDX

Currently im developing a Worms Like game in LibGDX. So i already implemented the firing of projectile and now i want it to move in a Sine Wave Motion while in air. Heres the code of the Bullet that ...
1
vote
1answer
2k views

Create apk from libgdx project

What is the basic procedure to create the signed apk for my libGDX project? I am new to libGDX so provide some guidance. I am talking about deploying apk to the Android market. I have to ask this ...
2
votes
1answer
682 views

Libgdx import bin/xml/json from physics editor

I'm using Libgdx. I did a simple json file in Physics Body Editor and I don't have any idea how could I import it into my physic world in libgdx. Any idea will be appreciated. P.S: Sorry if there ...
2
votes
5answers
165 views

Infinite Jumper Snow Effect

I wish to achieve a snowing effect on my game. The game is made in LibGDX and im using ParticleEmitter. I created a snow effect in ParticleEditor which consists in a line which spawns snow flakes. The ...
0
votes
1answer
87 views

Sprite draw-order in libgdx

From other frameworks I know methods for easy ordering sprites within a spritebatch (to determine if a sprite has to be drawn in front or behind another sprite). For example in MonoGame/XNA this is ...
0
votes
1answer
55 views

How does super.render() call this method?

Today I was experimenting with adding different screens with Scene2d in libgdx and while doing so I became confused how super.render() in my render() method from my starter class (MyGdxGame) called ...
0
votes
0answers
40 views

How can I scale dialog text in libgdx?

This is what I have and in this case for some reason only the back to menu button is scaled... public class GameOverWindow extends Dialog { private BitmapFontShader bitmapFontShader; ...
0
votes
0answers
26 views

[LibGdx]Moving a fixture on a body

I'm working with Box2D and I have a basic platform and a box bounces off of it. // Static Platform bdef.position.set(160 / PPM, 120 / PPM); bdef.type = BodyType.StaticBody; Body b = ...
0
votes
0answers
75 views

Incorrect click event when resize on libGdx

I want to use scene2D, in libGDX, to detect click on object. I have this simple Game sample : Stage stage; @Override public void create() { this.stage = new Stage(1280, 720, true); ...
0
votes
0answers
84 views

Gdx.graphics.getDeltaTime(); Returns 0

I am coding a game in Java using Eclipse and Libgdx. I am trying to make an object move until it reaches a certain random point. I am relying on delta time to make the objects speed the same on ...
2
votes
2answers
126 views

Implementing Mouse Lasso

I am toying around with a Boogaloopers clone (http://www.youtube.com/watch?v=zuaRi_fhdlQ). I have a small problem with the lassoing. Here's my current naive algorithm. The problem with this is that ...
0
votes
0answers
39 views

Libgdx project “Not Responding” when in debug mode

So the problem I am encountering is that whenever I attempt to debug my Libgdx desktop project and Android project the "app" is constantly "frozen" or "Non responding." By this I mean that I cannot ...
1
vote
1answer
68 views

Box2DLights - the center of sprites are always 100% unlit (black) unless Xray is on

I'm using a ConeLight at 180 degrees, with this setup: pl = new ConeLight(rayHandler, 256, new Color(0.5f, 0.5f, 0.5f, 1f), 280f, 400 - x, 300 - y, 0, 180); And the object I'm casting a shadow on ...
0
votes
0answers
18 views

LibGDX: Its there any way to calculate the speed of a repeated scrolling background?

I'm trying to calculate the scrolling speed of an background, I'm doing something like this on the background class: private Texture texture = new Texture(Gdx.files.internal("backgound.png")); ...
0
votes
1answer
76 views

Rotating a vector around a vector in 3D space

I am trying to rotate a moon around a planet (the planet is also rotating around an axis) but I am having trouble doing so. I tried to make the model move through space like so: @Override public ...
0
votes
0answers
42 views

Google Play Game Services - Handling messages via p2p, host or no host?

I am developing a real time multiplayer game using Google Play Game Services. The underlying networking is done via P2P. Everything I read says I should still have a game host that sends out all the ...
7
votes
2answers
3k views

LibGDX - Check if currently on Android/Desktop

I'm using LibGDX and flixel-android to build a Desktop/Android game. It feels like there should be a way of checking to see if you're currently being run on an Android device, the Desktop, and so on, ...
0
votes
0answers
44 views

Graphical Designer for creating in game objects

I am creating a 2D endless scrolling game . The game needs to have a repetitive object , say a building with random width and height . But the basic color and features like window shape of the ...
0
votes
1answer
79 views

libgdx custom shape overlap detecting

I'm writing my game on libgdx w/o any of those extensions like box2d and whatsoever. But right now I'm forcing problem with overlapping detection. I need to detect if bullet (which is always in ...
0
votes
1answer
65 views

How can I increase text using scale and keep the text smooth in libgdx?

I found that I can use DistanceFieldShader from here and found an example but I couldn't make it work. First my whole screen becomes white, all the other actors that I have on screen disappears. ...
0
votes
0answers
65 views

Using Tiled (tile maps) for creating just parts of the game

I am creating an endless scrolling 2D orthogonal side scrolling game. But I am having an issue : In my game I want certain buildings to be there of random widths and height. Now the buildings are not ...
3
votes
1answer
201 views

“Pixel-perfect” camera positioning in 2d game

I am writing a 2d game using LibGDX. The view to the game world is top-down. The game shows a grid of lines, which looks nice when the camera is at its initial position (0,0). The problem is now that ...
0
votes
0answers
31 views

Only 1 character prints in LibGDX

I'm creating a simple menu in LibGDX and following a Stage/Table approach. I have a header, and a TextButton. Both have some text to them, but both only show 1 character. For example, the header ...
0
votes
1answer
877 views

Dependency setup between libGDX projects in Eclipse IDE

For my game I'd like to create another project that extends the functionality of libGDX and since it will be an independent project it could be easily reusable. How can I achieve this in Eclipse IDE? ...
1
vote
1answer
171 views

If I convert my LibGDX game to an exe, is it legal?

I have a LibGDX jar file, and I want to have it as an EXE. Would that be legal? (Using launch4j) Also, how do I obfuscate a LibGDX game?
0
votes
1answer
83 views

Is Table the only layout that I can use in libgdx?

I'm looking for the common way to handle the layout in libgdx. I searched google and found only table layout. Meanwhile I don't use any layout and just insert coordination into each visual object but ...
0
votes
1answer
113 views

The sprite will not move in libGDX

When I ran the android application, The sprite image will not move when I press the input keys. I followed a tutorial based on input keys and wish to know what's wrong. Can anyone see what's wrong? ...
0
votes
0answers
24 views

Correctly identifying a Fixture from an extended class in Box2D's ContactListener

Sorry for the confusing title, I dont know how to resume it that much. Im making a game, and I have a simple class Mob which is extended by Warrior and Enemy. A Mob has a Body, and that body usually ...
4
votes
2answers
165 views

How to make a smooth circuit path in Universal tween engine?

I tried to make a circuit by starting at point A, with waypoints B and C and final target at A again, and infinite repeats. What happens is that the path from A to B, B to C is smoothed, but path C to ...
0
votes
1answer
56 views

Bodies going through the walls of a box

I have a game where the user controls a box to collect falling balls. However, very often the balls will just fall through the walls of the box and be flung away. What could be causing the balls to do ...
1
vote
0answers
155 views

Slick2D v LibGDX: [closed]

Okay. You might have seen some of these posts on forums here and there, but I wanted to ask this here mainly because everyone here is focused on game-dev and there seems to be quite a few Java ...
0
votes
0answers
11 views

swapActor not movings the actors

I'm trying to use myTable.swapActor(Actor a,Actor b). It does return true, so it should swap the items, however, nothing's moving. Is there something I've not seen in what the function really does? ...
0
votes
1answer
78 views

neon effect to textures libgdx [duplicate]

I am working on a live wallpaper with Libgdx . I am wondering if I can give neon glow to my textures , at runtime . Is this possible? If yes can anybody give me any pointers?
0
votes
0answers
56 views

Sprites on scrolling tmx map (LibGDX)

I have .tmx map loaded, and a camera to see it. The map is bigger than the camera viewport, so I need to move that viewport scrolling the camera. Now I want to draw a sprite on the map. To do that, at ...
0
votes
2answers
134 views

How do i make collision detection more effective?

In the game i am developing, there are 220 circles that are not moving. One of the circles is moving and in every update, it iterates through an ArrayList that contains all the circles and check if it ...
0
votes
2answers
95 views

How do i initialize and use a Texture Array? LibGDX

First of all, I am new to Java and LibGDX.. What I am trying to do is Load my texture images into an array so that I can reference them in my drawing code by number, rather than by name. I am drawing ...