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
votes
2answers
83 views

Libgdx, find Vector3 direction

I am using Libgdx along with Bullet physics. I have a vehicle moving. I would like to use a ray from the vehicles origin and in the vehicles forward direction. How can I create the forward Vector3 ...
0
votes
0answers
39 views

Bullet Physics for Collision Detection and Smooth Response

I'm creating a game using LibGDX, and to prevent the need to spend lots of time writing collision detection code I've decided to make use of Bullet Physics, simply for collision detection and not for ...
0
votes
1answer
35 views

LibGDX Bounding Rectangles

I'm creating some rectangles surrounding my sprites for my player and bullet class to detect collisions with the overlaps method in Intersector class of LibGDX. I have a question: When I instantiate ...
2
votes
1answer
310 views

Setting uniform value of a vertex shader for different sprites in a SpriteBatch

I'm using libGDX and currently have a simple shader that does a passthrough, except for randomly shifting the vertex positions. This shift is a vec2 uniform that I set within my code's render() loop. ...
1
vote
2answers
134 views

How to create Whirlpool/Vortex effect?

Im trying to make a Vortex effect on a Circle Body that is a Sensor. I've been looking for this and all examples i look for are in C++ or Objective C and i dont seem to translate them well. when my ...
0
votes
0answers
9 views

GdxRuntimeException uiskin.atlas

I have problem when trying to use the uiskin.atlas from github/libgdx. I've downloaded(cloned) it from libgdx.git but it just doesnt work. I get the following error: ...
2
votes
1answer
645 views

Libgdx - IsometricTiledMapRenderer and light shading

I am wondering if there is any way to simulate light shading in Libgdx using an IsometricTiledMapRenderer. Here is my code to draw an isometric map, it's able to be moved around with the mouse and ...
0
votes
1answer
39 views

Why does my libgdx app just display the badlogic.jpg instead of my start screen?

I have been looking at example libgdx games. It looks like https://github.com/libgdx/libgdx-demo-cuboc is the closest thing to a game I would like to make. I am able to download, compile and execute ...
0
votes
0answers
29 views

libgdx y axis rotation (card flip)

I am a complete new user to libgdx and am looking to use it to write a simple card game. I want to be able to flip my cards over to reveal them, in the same way as this example from Google shows. ...
0
votes
0answers
14 views

Using fonts in Scene2D GUI

I'm learning how to use Box2D and Scene2D together. I'm trying to create a Sprite class that combines a Box2D body with a Scene2D actor. Before I can do this I need to set up the environment I plan to ...
0
votes
0answers
39 views

Problem with changing font color in libgdx

I recently noticed that my version of libgdx was way out of date, so I updated from version .9.something to 1.4.1. I copied files for the project I'm working on over into a new project generated with ...
2
votes
0answers
42 views

Drag And Drop in libGDX (Target and Source)

I'm trying to put together a drag and drop system in libGDX with the help of DragAndDrop class. I have the typical system in which you can drag something into a box. So far it is working all dough I ...
1
vote
1answer
88 views

How can I implement a camera like the one in RotMG?

RotMG, an MMO top-down shooter, takes on a unique 2d-3d style, and has an intriguing camera; The game is obviously 3d, not simply isometric, and if you play the game and turn on camera rotation you ...
0
votes
0answers
23 views

Change a vertices and display corner of a polygon

I'm currently building a level editor for my game and i'm having some trouble on how to change vertices of a polygon. Basicly i searched the web trying to figure out how to update the vertices of a ...
1
vote
2answers
88 views

Random undirected graph generation

I would like to generate graphs randomly, like this: I have found that Box2d maybe can do it to me. But I do not know, how to use it, so how can I generate bobies after world initialization?
0
votes
0answers
21 views

Cant Set Image Origin in Table Cell - LibGDX

I am having real issues with my Actors when placed in table cells. I would like to set center Origin to allow me to tween the scale around the center. I am aware that the Table is responsible for ...
3
votes
2answers
501 views

How do I crop a camera's viewport?

I'm making an Android game using LibGDX. I would like to render a cropped version of the camera's viewport. Here's an original camera view (in 3ds max): I can get the same view in LibGDX without ...
0
votes
0answers
21 views

In libgdx, how do I get the intersection of a ray with a model instance?

I am using LibGDX trying to use raypicking to pick a point on a Mesh. I have two methods for this that don't seem to work quite right: /** * @param ray * @param intersection The vector to store ...
-1
votes
1answer
60 views

How to mirror a texture in libGDX

Is it possible to rotate my sprite in LibGDX? public class Flame { private static final int FRAME_COLS = 6; private static final int FRAME_ROWS = 1; private Animation flameAnimation; private ...
2
votes
1answer
66 views

How can I get the instantaneous volume level of a sound at a particular playback point?

How can I go about getting the current volume output of an audio file in libGDX? By that I mean of the actual file at its current play position. Essentially I want to write my own version of a plugin ...
0
votes
1answer
367 views

What is the approach of creating an image puzzle game with libgdx

I would like to create a game which consists of taking a random image, slicing it up into some number of pieces (according to a selected difficulty) and letting the player solve the puzzle. I've ...
1
vote
1answer
51 views

Libgdx - gesture dection

I have made a card game, and have two methods that sort the players hand. sortHandBySuit(); sortHandByValue(); I would like one method to be called when the user slides their finger from left to ...
1
vote
0answers
44 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
0answers
29 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
27 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 ...
1
vote
2answers
145 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. ...
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
33 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 ...
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
54 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
37 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 ...
0
votes
0answers
36 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
78 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
88 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
32 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
83 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
42 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
404 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
66 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
123 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
49 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
667 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 ...
1
vote
1answer
78 views

Smooth anmiation with LibGDX

I want to move a enemy from its current position toward the mouse position in LibGDX. x, y - enemy position saveX, saveY - position where my enemy need to go(or mouse position saved at specific ...
0
votes
0answers
199 views

libgdx building 3D terrain

I've been spending a lot of my time working with libgdx scene 2d & have become very familiar with it. I've decided I want to move over to 3D & take a couple of weeks to learn & better ...
1
vote
0answers
54 views

Why does my texture-based object picking detect the wrong object? [on hold]

I am a LibGDX beginner implementing a RISK-like game. I want to let the player select territories by clicking on them, but for some reason, the wrong territory is sometimes detected. The clicked ...
2
votes
0answers
48 views

Why do my Box2D bodies occasionally get stuck and separate forcibly?

I'm making a space game with LibGDX and Box2D. I made a video here to illustrate the issue. Verbal description: When objects collide, they sometimes get stuck together and are then suddenly separated ...
0
votes
0answers
51 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
0answers
34 views

Box2D - create object with different physic parts

I have object with physic: BodyDef bodyDef = new BodyDef(); bodyDef.type = BodyDef.BodyType.DynamicBody; bodyDef.position.set(position); bodyDef.angle = angle; ...
0
votes
1answer
76 views

Box2D object wont move until tons of force is used

Im making a game for android im using LibGDX and Jbox2D it is a space flying exploration game controlled with the accelerometer. so I have set the world to no have no gravity. the objects in Box2D ...