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
1answer
38 views

Throwing a bomb LibGDX Box2D

I am trying to create game where somenone throw a bomb. I am wondering how I can have an bomb react in a way that is represented by the following picture : Is there are any tools in Box2D that can ...
0
votes
1answer
57 views

Mouse coordinate conversion Libgdx

I have a camera: //Map is a my object that wrapper of TiledMap class In the create method: this.renderer=new OrthogonalTiledMapRenderer(this.map.getMap(); this.camera=new OrthographicCamera(); ...
0
votes
1answer
56 views

LibGDX - Accelerometer Problems

I got some issues. I'm using LibGDX. When I hit an object, my Fighter is supposed to fall to the Ground. BUT, because of the Accelerometer, i can still move it up and down eventhough it died. The ...
0
votes
0answers
22 views

Lighting shadow casting sprites with box2Dlights

I currently have something like this using box2Dlights Ideally, I would like objects casting shadows to be lit, so the object is lit but there is still a shadow cast around it. Right now the object ...
0
votes
1answer
457 views

How can I create a button with an image in libGDX?

I am new to LibGDX. I am trying to develop a game for Android (so it will support different screen sizes), but I don't know how to put a button with an image. I tried ImageButton but I can't resize ...
0
votes
0answers
28 views

Tap responsiveness on mobile

My question is quite simple but I hope someone can help me here. My problem is the delay when the screen is tapped. In my game there are fast moving images that need to be tapped. I have the touch ...
0
votes
0answers
17 views

Move body LibGDX Box2D

Hello I have a body and I want to move it. When I press the mouse button my body should move at that position (on the const speed)on the screen. I have override two methods(x1, y1 - point where my ...
0
votes
1answer
47 views

Ram usage , libGDX game development

I am developing android game using LibGDX . The game data (images , sounds etc.) are maximum 25mb . But when the game is running on Android device it places 110mb there (look at the image) 110mb is ...
0
votes
2answers
991 views

Problem with AssetManager while loading a Model type

Today I've tried the AssetManager for the first time with .g3db files and I'm having some problems. Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: ...
1
vote
2answers
131 views

How do I handle game lag due to background apps

I'm developing a game using libgdx and have noticed on several occasions that other background apps running can cause lag in my game - especially when those apps are being updated in the background. ...
1
vote
1answer
189 views

Multiple enemy array in LibGDX

I am trying to make a multiple enemy array, where every 30 secods a new bullet comes from a random point. And if the bullet is clicked it should disapear and a pop like an explosion should appear. And ...
0
votes
1answer
196 views

Does libGDX support the Xbox One controller?

I just bought a Xbox one controller and i'd like to test my game with it. I use the Controllers extension from libGDX and it works fine, at least with my PS3 controller. I get some weird results when ...
0
votes
1answer
229 views

How can I implement online high score in LibGDX?

I found some posts that said to use Google Play Services. What about other platforms? Is their some libgdx library that I can use to implement it in core section or do I need to write separate score ...
0
votes
1answer
64 views

How to check in single event if two objects are clicked at the same time in libGDX?

I am newbie to libGDX and I have written two functions for touchdown, LockerKeyHalfImage.addListener(new InputListener() { public boolean touchDown (InputEvent event, float x, float y, ...
0
votes
1answer
36 views

Loading TextureRegion with filter diff from that of texture it came from

I am using libgdx . While packing my texture atlas I have set the filter for mag and min to Nearest . But for just one region I wish to draw it with linear filter . Is it possible to have different ...
3
votes
3answers
3k views

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

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? ...
0
votes
1answer
39 views

libgdx universal tween engine how to control the tweening speed?

How can i control the speed of a tweening sprite? Here is the code: in create () /*try tween*/ w = Gdx.graphics.getWidth(); h = Gdx.graphics.getHeight(); ...
1
vote
1answer
473 views

How to move Vector2 along angle?

These are my Vector2's that I am using for this function. public Vector2 position = new Vector2(); public Vector2 velocity = new Vector2(); public Vector2 movement = new Vector2(); public Vector2 ...
0
votes
1answer
56 views

LibGDX Box2D TileGame Efficiency

I am trying to implement Box2D into my top down tile game in LibGDX. Each world consists of a set of chunks, and each chunk is 16 tiles wide/long. The maximum/minimum chunks loaded at one time is 9 (a ...
0
votes
2answers
1k views

How do I calculate the z-coordinate for a perspective-camera in 2D?

I'm new to LibGDX and trying to use DecalBatch with PerspectiveCamera, simply to have Z-coordinate for my sprites, as SpriteBatch does not offer that. However, I don't know how to calculate the ...
0
votes
1answer
706 views

libgdx actors and instant actions

I'm having trouble with actors and actions. I have a list of actors, they all have either no action, or 1 sequence action This sequence action has either : a couple of actions (some are instant, ...
0
votes
1answer
26 views

Box2D pixels to meters , LibGDX

I am confused . what shall I set the orthographic camera viewport in libGDX when I use box2d , in one tutorial I saw that he divided his viewport numbers to 32 because 1meter =32 pixel , but I think ...
0
votes
3answers
237 views

What is the easiest way to make an object follow the edge of a sprite?

I have a rounded rectangle sprite and another sprite that's just a circle. I want the center of the circle to follow the edge of the rounded rectangle. Is there any easy way to accomplish this task? ...
6
votes
1answer
2k views

Why do my images take 200 MB of RAM when they are ~20KB on disk?

I am creating an Android game using libGDX. When I load my nine images it takes 200 MB of RAM. But the images are 10 to 17 KB each. Why the discrepancy? Here is where I create textures from those ...
0
votes
1answer
46 views

libGDX new TextureAtlas(filename) and new Texture(filename) drawing stale image data

I'm trying to draw an image using libgdx but no matter what I do, libgdx seems to insist on drawing a portion of an image I had loaded and used in an earlier game screen. In my current game screen ...
0
votes
1answer
29 views

Libgdx with Scala: Overwrite listener

I try to learn Scala the fun way, with a little libgdx project. Now I'm somewhat stuck: val go = new TextButton("Go", style) go.addListener(new ClickListener() { override def isPressed() : ...
1
vote
1answer
25 views

box2D and libgdx: Attach ParticleEffect to Body

Hello I am a newbie with libgdx, my question is: how could I add a Particleeffect to a Body that is moving? I searched about the matter and I didnt find anything related to it. I have the following ...
0
votes
1answer
48 views

Box2D Body creation causing performance issues

I have at max 10 dynamic bodies in my world at any time. they are created at random and fired up from below they screen. when a new body is being created, the fps falls from 59 - 61 to about 35- 40 ...
0
votes
1answer
249 views

libgdx ActorGestureListener.pan() parameters not moving actor in smooth line

I override the pan method in ActorGestureListener to implement dragging actors in libgdx (scene2d). When I move individual pieces on a board they move smoothly, but when moving the whole board, the ...
1
vote
1answer
93 views

Making sprite rotate smoothly

I have a sprite that I want to rotate smoothly and face the opposite direction: This is my render function: public void render() { // Game Loop Gdx.gl.glClearColor(0.7f, 0.7f, 0.2f, 1); ...
1
vote
1answer
238 views

Touchable Hud with Actors in Libgdx

I am writing a Tower Defense for Android. Right now my LevelScreen contains a Background-Actor which is pan-able and some zones to buy Towers - after buying them you can upgrade them further. When you ...
0
votes
1answer
62 views

Using SVN with Libgdx

I decided to give LibGDX a try and am planning to use SVN for my code repository. I created my LibGDX project via the Gradle build as outlined in the book "Learning LibGDX Game Development". I'm not ...
0
votes
1answer
31 views

Making sprites move in oppsite direction of vector

I have a sprite that moves from the bottom left of the screen to the top right. What I want to know is how would i make it turn around and go in the opposite direction, and continue this loop. I ...
1
vote
2answers
378 views

Matrix rotation wrong orientation LibGDX

I'm having a problem with matrix rotation in libgdx. I rotate it using the method matrix.rotate(Vector3 axis, float angle) but the rotation happens in the model orientation and I need it happens in ...
2
votes
1answer
597 views

How to correctly set window size in Libgdx scene2d.ui dialog

In my libGDX application I am using the scene2d.ui classes to render my game's GUI. One of the things I render via these classes is a dialog window with a background image set. I have created the ...
0
votes
1answer
284 views

How to follow object on CatmullRomSplines at constant speed (e.g. train and train carriage)?

I have a CatmullRomSpline, and using the very good example at https://github.com/libgdx/libgdx/wiki/Path-interface-%26-Splines I have my object moving at an even pace over the spline. Using a simple ...
1
vote
1answer
169 views

Word game - board implementation?

I'm working on a boggle type game for android, using libgdx. The user is presented with a 4x4 grid of letters and must find words by dragging their finger over the letters. Unlike boggle I want used ...
1
vote
1answer
85 views

Vertical alignment of a padded font generated by Hiero in libgdx

I've generated bitmap fonts for libgdx using Hiero. I've got several distance field fonts that require a lot of padding, unfortunately they don't seem to align correctly. Below is a font with a ...
0
votes
0answers
35 views

LibGDX - Tiled Map Layer Collision [duplicate]

I'm currently using LibGDX for a Atari 2600 style dungeon exploring game. I use the Tiled map editor as my editor of choice. Plus it's the best in my opinion for mac. I'm using LibGDX because of it's ...
0
votes
1answer
55 views

How can I change the appearance of the mouse cursor in libGDX?

How can I change the mouse a cursor to a picture using libGDX?
0
votes
0answers
57 views

Box2D shape/fixture position vs. body position

I load my rectangular shapes from a simple Tiled level into libGDX and want to create a physics world out of it via Box2D and attach sprite assets for rendering. I get the tiled object layer and ...
0
votes
0answers
27 views

(libgdx) how to make an actor transmits the events it receives to its children?

I use the following class : public class InGameMenu extends Actor{ /** VARIABLES **/ private boolean debug= true; private float x,y,width,height, margin; private static final String TAG = ...
1
vote
1answer
73 views

How would you declare a Texture object in the libgdx skin json file, using a region from a texture atlas?

I have a texture atlas that is linked to my skin.json file. The atlas contains a region named "game-title". I would like to declare a com.badlogic.gdx.graphics.Texture object in the json file, to ...
1
vote
0answers
32 views

Changing Box2D Body from Kinematic to Dynamic after contact

What is the correct way to change a Kinematic body into a dynamic body? context - I have a dynamic body as a projectile which has to be fired at a kinematic body (it is kinematic because i am ...
1
vote
2answers
337 views

Cover Screen with Snowing Effect in Libgdx

Oddly enough I cant find clear instructions on this theme (I only found rain and the method is very particular) so I ask, how do I implement a whole-screen snow-falling effect? The methods i can ...
0
votes
1answer
62 views

Only render/calculate the chunks in frustum!

I have a 2D world in form of a Block[][]-Array that holds all the blocks of the world. Every block has it's own Box2D Body (I want a "minecraft"-like 2D world for this project). Naturally I don't want ...
0
votes
3answers
1k 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 ...
1
vote
1answer
103 views

White background on BitMapFont

I've tried placing a white "background" on a font that is being rendered with LibGDX, with no success. I'm using the font.draw to draw the loaded font on the screen, but every way that I tried, the ...
0
votes
0answers
41 views

libGDX fixed object and camera do movement

I develop game to andorid and there is moving object with arrows - simple movement like in RPG games. I did: camera.position.x = PIXELS_PER_METER*man.body.getPosition().x; camera.position.y = ...
0
votes
2answers
566 views

Libgdx detect when player is outside of screen

Im trying to learn libGDX (coming from XNA/MonoDevelop), and I'm making a super simple test game to get to know it better. I was wondering how to detect if the player sprite is outside of the screen ...