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
2answers
933 views

How would I generate random falling objects

I'm creating a game using libgdx on Eclipse that is similar to Ragdoll Avalanche. I'm looking for a way to generate falling objects like the triangles of Ragdoll Avalanche. All I know that i have to ...
2
votes
2answers
4k views

Change alpha to a Frame in libgdx

I have this batch.draw(currentFrame, x, y, this.parent.originX, this.parent.originY, this.parent.width, this.parent.height, this.scaleX, this.scaleY,this.rotation); I want to apply the alpha that ...
1
vote
1answer
2k views

Using NinePatch in libGDX for Loading Bar

I am trying to create images for a loading bar in libGDX. I came across the NinePatch class and I was hoping to use it for this loading bar, since stretching images with a plain Texture or Sprite ...
2
votes
1answer
3k views

Using the same font with different sizes in libgdx

I am using BitmapFonts, LabelStyles and Labels for my texts. I want to resize some labels, so i use this. fontType.scale(-.6f); LabelStyle style = new LabelStyle(fontType, Color.WHITE); titleLabel ...
4
votes
1answer
3k views

libGDX Multitouch Controls

Has anyone had any trouble implementing multitouch on-screen controls in libGDX, such as multiple joysticks? I've tried and I can't seem to get libGDX to play nice with multitouch/multiple pointers on ...
4
votes
1answer
5k views

Using the AssetManager in LibGDX

I am trying to use the AssetManager class in LibGDX and I understand how it works but I am trying to implement a loading screen. I have followed the AssetManagerTest.java file here, but I am having a ...
5
votes
3answers
7k views

Changing the color of a sprite at runtime

Is there a form to change the color of a sprite in runtime?} I have a black point loaded with an image, but i dont want to load various images with different colors, is there a mode to change the ...
1
vote
1answer
4k views

Waiting specific time to increase sound libgdx

I want to wait a moment (.5 seconds) before I increase the sound, how can i achieve this without using Thread.sleep, because i want my game to keep runnig.
1
vote
0answers
310 views

Which game engine is more worthwhile for mobile game development [closed]

I have been thinking of starting to learn mobile game development. I recently learned that there are three popular game engines available for android: AndEngine cocos2d-android libGdx you guys ...
1
vote
5answers
1k views

Errors happen when using World.destroyBody( Body body )

on Android application using libgdx, when I use World.destroyBody( Body body ) method, once in a while the application suddenly shuts down. Is there some setting I need to do with body collision or ...
0
votes
1answer
1k views

removing box2d objects before collision occurs

I am having a problem with a collision detection between the character and items, both created as box2d objects. What I am trying to do is to delete the item or remove item from the collision method ...
0
votes
1answer
2k views

Creating lots of sprites dynamically in libgdx

I´m creating Groups that contains Sprites and adding bodies with box2D, but when I create many of this my animation gets very slow. How can I handle it?
6
votes
1answer
1k views

SQLite in libGDX

Does anyone have an example of how I can use SQLite in libGDX? I have a class in my original Android code that allowed me to easily access a database but I can't seem to find anything equivalent to ...
1
vote
1answer
792 views

Scaling bodies in box2d and libgdx

Is there a way to scale the bodies made from vertexes (like a guitar), i was trying to multiply each vertex point by the scale value but c++ mark an assertion failed, is there a mehtod to do this? I ...
11
votes
3answers
13k views

Resolution Independence in libGDX

How do I make my libGDX game resolution/density independent? Is there a way to specify image sizes as "absolute" regardless of the underlying density? I'm making a very simple kids game; just a bunch ...
0
votes
1answer
899 views

Maintain speed in box2D body

I want to delimit my speed and to maintain that speed constantly, but it gets getting higher and if i apply the linear velocity it doesnt bounce :/, Here is te part of my code double fx = ...
0
votes
1answer
829 views

libgdx spite position relative to body

Apologies if this is a reiteration, as I couldn't find another discussion of this over the past couple days. Issue: I'm using libgdx and box2d, and I'm currently updating the sprite's position to ...
2
votes
1answer
2k views

Speed of bodies in Box2D and libgdx

I want to move my bodies at higher speeds, but they have a top speed. I have an Ortoghraphic camera defined at 800x480. My world doesnt have gravity. I apply an impulse of 1000,and a force of 1000 ...
0
votes
1answer
375 views

Make a callback to android methods from libgdx

How can I make a callback from libgdx to an Android method? I want to use the method to overwrite a file in the internal memory.
1
vote
4answers
6k views

How do I save files with libgdx so that users can't read them?

Writing my game in libgdx, I arrived at the point when I need to save the player stats and the info of the levels. However, in libgdx it's not allowed to write the file inside folder of the ...
6
votes
1answer
853 views

What methods should save/load a game state

There are a lot of articles about how to save a state of a game and they are pretty good. But I have one conceptual misunderstanding where should I save the state? My game has number of screens and ...
2
votes
1answer
3k views

Pop up screen on libgdx

Hi I want to make a pause and credits screen for an android game with libgdx the idea I have is creating a new screen like a popup that pauses the background screen and then, I can render the screen I ...
0
votes
1answer
3k views

How to know if an actor is touched in libgdx?

I am using "Gdx.input.isTouched()" in the render method of my Screen method, to know where is touched, but when the touch is dragged in the screen, it also activates the events i want only when an ...
5
votes
2answers
1k views

Detect if a sprite has left the camera in libgdx?

Is there a method to know if a sprite has left the camera of the stage? or I have to do my operations? :P
2
votes
1answer
1k views

Relative and absolute position with sprites in libgdx

In libgdx, can i add a sprite as children of another an set it with the relative coordinates of the father and not the stage? Like in HTML when you add controls they are relative to its parent, but ...
0
votes
1answer
2k views

How to use the actions of the actors in libgdx?

I'd like to know if someone has already used Actions in the actors, and how to use them. I don't know how. I want to rotate an Actor.
4
votes
1answer
3k views

sprite display does not match its body in box2d

I found about this using debug renderer. When game starts, everything is in order. But when some collision happens, sprite's rotation is way larger than its body. When sprite and body match is the ...
11
votes
1answer
4k views

How can I define a complex collision area on top of a tile map?

As many people recommended, I am using Tiled map editor to create a map for my game and it's great particularly because libgdx framework also provides with API for maps from Tiled. I understand I can ...
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 ...
3
votes
2answers
3k views

Vector images (SVG or other formats) support in libgdx or other Android framework?

I'm looking for a website to create games for Android. I'm interested in something that supports vector images. Do you know if libgdx supports them or is there a convenient way to use them in libgdx? ...
2
votes
1answer
932 views

Ball bouncing and throwing, how to?

I was given a task to make a 3D game for Android, but since I never programmed games and opengl until now I'm totally lost on how and where to start. Right now I'm using libgdx framework to ease my ...
4
votes
1answer
5k views

How to use particle editor for libgdx?

In the libgdx wiki, this particle editor is recommended. And this blog was helpful. But the problem is that I am not sure yet how to use it for my game. Let's say I want to have a fire-effect in my ...
6
votes
1answer
5k views

Is libgdx fit for 2D game development on Android or are there simpler alternatives?

I'm looking for a Java framework to develop 2D games on desktop and Android. I've looked at Slick and I really like the API, however the developer himself says if you want a framework for Android and ...
7
votes
3answers
6k views

Advantages and disadvantages of libgdx [closed]

I've been an android developer for a while and am thinking about getting into gaming. While looking for a game dev framework, I thought libgdx provides very friendly documentation and functionality. ...
2
votes
3answers
2k views

How do I change my gravity and jumping logic to put the character at a specific height at a specific point in time?

I'm making a 2D platformer on Android using libGDX. One thing I've had a problem with recently is gravity and jumping. I found a few tutorials on the internet and was able to come up with this... ...
0
votes
1answer
390 views

Almost working 2D Collisions

I'm terribly sorry I'm asking this question YET AGAIN, but I can almost guarantee that this will be the last time I'll have to ask. I'm currently on the verge of FINALLY getting these collisions to ...
3
votes
2answers
2k views

How to make a background fill the screen on different-resolution phones?

I am developing my first Android OpenGL game. It's a 2D game and I would like the background to always fill the screen. I've managed to achieve this by stretching the texture to fit the size of the ...
5
votes
4answers
6k views

2D Platformer Collisions

I've basically asked this question before, and I know it's been asked probably a billion times, but I still can't seem to do it. All I want to know is how I should go about doing basic 4-way, ...
1
vote
4answers
2k views

Basic 2D game collision

I've been trying to program a game for the past while and I can't ever figure out one thing: collision detection. I can get up+down and left+right to work, but when I put them together, they interfere ...
4
votes
1answer
2k views

How can I track a falling ball with a camera?

I have been trying to get my camera to follow a falling ball but with no success. here is the code float cameraY = (FrustumHeight / 2)+((ball.getPosition().y) /2) - (FrustumHeight /2); ...