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
0answers
17 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 ...
0
votes
0answers
7 views

Libgdx desktop windows resize

I have tried to make game with libgdx I want to create 3x3 grid in the middle of screen I ran the desktop project, it seems that not much problem at all, but if I resize the windows the 3x3 grid move ...
0
votes
0answers
24 views

Can't get libGDX to work! [on hold]

I was just trying to make simple game using libGDX, just to try it out, but it looks like I can't set it up. I am using Eclipse+ADT bundle. I also set the android sdk location there. The only thing I ...
0
votes
2answers
40 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
26 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
0answers
16 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
0answers
60 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
39 views

Why does my texture-based object picking detect the wrong object?

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

Sprite rotation 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 ...
0
votes
0answers
15 views

Lag in game LibGDX [closed]

I'm currently developing a game with LibGDX engine and my character sprite sheet animation is not smooth enought while he is moving. Also I have coin which rotates very smoothly in that game. So one ...
2
votes
0answers
31 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
2answers
66 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. ...
0
votes
0answers
15 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
0answers
15 views

How can I rumble/vibrate my controller with libGDX?

The API in the extension in com.badlogic.gdx.controllers.Controllers only supports getting the input data (works fine). Is there a way to make my controller rumble/vibrate using some other ...
0
votes
1answer
63 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 ...
0
votes
1answer
27 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
69 views

libgdx glClearColor not setting right color?

i just new to libgdx and trying to understand the example code, the following code sets the bg color Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); Gdx.gl.glClearColor(60,181,00,0f); my ...
1
vote
1answer
65 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 ...
-1
votes
0answers
35 views

LibGDX Texture width and height must be powers of two

public class Game implements ApplicationListener{ public static int WIDTH; public static int HEIGTH; private Texture texture; private SpriteBatch batch; public static ...
0
votes
1answer
29 views

Steering in top-down racer with Libgdx

I'm a beginner in game development and as a little project I thought I should try to do a top-down racer game much like the good old Slicks n Slide. I've seen several tutorials and questions about ...
1
vote
1answer
22 views

Is there a Box2d b2World::ShiftOrigin function in Libgdx?

Is there an equivalent Box2d b2World::ShiftOrigin function in Libgdx? I can't seem to find it.
1
vote
1answer
13 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 ...
1
vote
0answers
40 views

JBox2D Objects moving slowly (pixel to meter conversion) (SOLVED) [closed]

This problem is solved When trying to program a game using Box2D, I ran into a problem with Box2D. I filled in pixel numbers for the lengths of the the textures and sprites to create a box around it. ...
1
vote
2answers
50 views

How do I make a pop-up window with Scene2D?

I have a main-menu screen with a logo and a bunch of buttons. When the Login-button is pressed, I pop up a dialogue asking for a username and password. This works fine, other than the "popping up". ...
0
votes
1answer
29 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
0answers
27 views

FPS drop after moved from Textures to TextureAtlas in LibGDX

I've started using LibGDX some time ago and I was making a test project to get used to this library. I've created some images and added them to the assets folder and loaded each image as a Texture ...
2
votes
1answer
35 views

Libgdx : point that scrolls on the edge of a circle

I'm not very familiar with libgdx vectors. I want to create my own joystick-controller and I want to know how can I find the coordinates of B by using Vectors. I can calculate the radius and I have ...
0
votes
0answers
82 views

How can I make a swinging rope?

Base question: How can I make a swinging rope in box2d? Context: The idea is to have a rope where the player can grab it, swing a little bit to get more "momentum" and reach the next platform. Like ...
1
vote
1answer
102 views

When Libgdx says “for Desktop”, do they mean native executables?

I want to clarify whether the Java Framework "LibGDX" can be used to compile games to native executables. The description/strap-line says "Desktop/Android/HTML5/iOS Java game development framework". ...
0
votes
1answer
30 views

Why can't I reference a sprite loading variable in a separate class?

When I reference a sprite I declared in a separate class that I am using to load images and rectangles, I get an error. Here's how I reference the image in the render method: ...
0
votes
2answers
58 views

get View from LibGDX for Android

I am making a LibGDX app, and I need to get the view to put to an Android app. Here is the code to get the view: package jangkoo.game.shadowfiend.android; import ...
1
vote
1answer
106 views

Why is there a huge update-delay in my client/server code?

I'm working on my Java game with Libgdx and having trouble with the network code. I can create a server, make multiple clients connect to it, but there is a huge delay between the player's input and ...
0
votes
0answers
26 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 ...
1
vote
1answer
58 views

How to properly change resolution

I'm trying to understand how LibGDX handles screen size / resolution, etc. Coming from XNA this seems very confusing to me. Basically I want to support 480x800 for my game. If the screen size is ...
1
vote
2answers
89 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 ...
2
votes
3answers
74 views

Box2d bodies that are really close together, are getting “stuck”

I'm using a tiled tmx map, and I created a class that adds bodies to each tile within a certain layer. This has been working great so far except for when a character or an enemy moves around on the ...
-2
votes
1answer
89 views

libGDX How to make camera follow the player? [closed]

I'm having some trouble getting the camera to even work at times. Thankfully, its some-what working now. I'm trying to get the camera to follow the players movement but nothing happens. (cut out the ...
1
vote
0answers
29 views

LibgGDX drawing two seperate Textures in FrameBuffer

So I am trying to combine multiple TextureRegions in to one by using a FrameBuffer. This works extremely well when the TextureRegions originate from the same Texture object/file but as soon as I try ...
0
votes
1answer
55 views

Set color by uniform per sprite using libGDX SpriteBatch

I am using a SpriteBatch to render large amounts of sprites very fast. Now I want to modify the sprites with shaders to tint them in a color. Problem 1: Altering an uniform by getting the shader and ...
0
votes
1answer
18 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() : ...
0
votes
0answers
29 views

How to get the amount of bytes received from KryoNet server?

I'm using KryoNet and I wanted to see how many bytes were were received from a server, could anyone tell me how could I achieve that? Please provide sample code or an example for how to do it.
0
votes
0answers
59 views

LibGDX MainMenu with ScrollPane - Select Level and press Play

In my level Menu, I am using tables that have images and text to identify each game level. Those tables are in a table that is inside a ScrollPane so the player can browse the levels available. Here ...
0
votes
1answer
68 views

Cant center screen between black bars

As I was trying to adapt my game to different device resolutions I ran into a problem when adjusting the game screen between the "black bars." In my case I am using the FitViewport class from the ...
0
votes
1answer
44 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
0answers
67 views

Libgdx/Box2D PolygonShape has no position… well, what now?

As my prototype works perfectly fine I want to advance to more fun areas of the project and add a more complex player-character body. So for Box2D I figured I'd need multiple fixtures, like one for ...
0
votes
0answers
27 views

LibGDX ShapeRenderer graphical glitches

So drawing something static on the screen with the ShapeRenderer is fine but whenever I try to move something it starts glitching out. Here's a vine to show what I mean: https://vine.co/v/OBxFi1P2IO9 ...
0
votes
1answer
58 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
0answers
29 views

Camera rotation issue Libgdx

I have a OrthographicCamera and I want to rotate 90° it, but when I rotate it seems to be shifted more to the right. Before rotation: http://postimg.org/image/tc9jpq9zr/ After ...
0
votes
1answer
73 views

Enemy spawning problem [closed]

I've been trying to get my characters to spawn at random points through out the map. I have a camera which is following my main character (2D RPG Style) around the screen, but I want these "enemies" ...
0
votes
1answer
61 views

Coordinates issue vertical scroll Libgdx

I'm going crazy with this problem. I'll explain: I have a camera that falls down (flowing along the y-axis) which displays a TiledMap and declare the whole in this way: In the create method: ...