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
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
35 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 ...
0
votes
0answers
45 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
103 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 ...
1
vote
1answer
226 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 ...
0
votes
2answers
170 views

2d Ice movement

I am building an top-down 2d RPG like zelda. I have been trying to implement ice sliding. I have a tile with the slide property. I thought it would be easy to get working. I figured that I would ...
0
votes
1answer
237 views

libGDX without android dependancies

I want to create a game that due to some assumptions doesn't make sense as a tablet game. I already created some frame (controllers, autowiring, build scripts, etc.) that would help me later on, but ...
1
vote
0answers
59 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. ...
0
votes
1answer
54 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
2answers
99 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". ...
1
vote
1answer
25 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
169 views

Make LibGDX game responsive to different phone screen sizes? [duplicate]

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 ...
0
votes
0answers
43 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 ...
5
votes
2answers
420 views

Running multiple box2D world objects on a server

I'm creating a multiplayer game using LibGdx (with Box2d) and Kryonet. Since this is the first time I work on multiplayer games, I read a bit about server - client implementations, and it turns out ...
0
votes
0answers
105 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 ...
0
votes
2answers
3k views

How do I move a body using the hardware accelerometer?

I want to move the ball as I move the device but I can not able to find how to use accelerometer in libGDX. I know that Gdx.input.getAccelerometerX() returns x coordinate but I don't know how to apply ...
2
votes
1answer
83 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
99 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
votes
1answer
43 views

Why can't I reference a sprite loading variable in a separate class? [on hold]

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: ...
1
vote
1answer
126 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 ...
2
votes
3answers
115 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 ...
1
vote
1answer
102 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 ...
0
votes
1answer
97 views

LibGDX - Textures rendering at wrong position

Update 2: Let me further explain my problem since I think that i didn't make it clear enough: The Y-coordinates on the bottom of my screen should be 0. Instead it is the height of my screen. That ...
0
votes
2answers
2k views

How to update libgdx scene2d Label text dynamically?

I display a BitmapFont on the screen, update its text and the font is updated dynamically on the screen as well. I seem to fail to do the same with a scene2d Label added as actor to a Stage. The ...
0
votes
1answer
53 views

How to initiate a TCP secure connection using LibGdx to a remote server?

Can anyone point to a link or share with me a piece of code which does: - Base on LibGdx (Gdx.net package) - Use a TCP secure connection to connect to a remote server Many thanks
2
votes
5answers
2k views

Hide collision layer in libgdx with TiledMap?

I'm making a 2D game with libgdx, and I'm using its TileMapRenderer to render my map which I have made in the map editor Tiled. In Tiled I have a dedicated collision layer. However, I can't figure out ...
3
votes
2answers
553 views

Yet another libGDX resolution independance question

I am developping a Android smartphone game in LibGDX, and I am encountering issues about resolution managing. Most notably, I have no clue how to handle that in LibGDX. For now, I am developping ...
2
votes
3answers
2k views

How to draw a rectangle or curve between two co-ordinates in libGDX

I am new to libGDX.I just want a Rectangle or a small curve drawn between the object and the clicked position .I know libGDX has RECTANGLE class. I just want to draw a rectangle or a curved line to ...
-2
votes
1answer
210 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
40 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 ...
1
vote
0answers
114 views

LibGdx Triangle Collision

I'm back with another question. I'm trying to get a collision between an actor and a sprite. With the actor, which only moves upwards and downwards, I've got no problem since it's shape is a ...
2
votes
1answer
311 views

How do I split a texture into differently shaped pieces with libgdx?

I want to split a texture into variously shaped pieces with libgdx, like the pieces of a puzzle game. TextureRegion.split() is not an option, as it splits into equally sized rectangular texture ...
0
votes
0answers
33 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
249 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
233 views

LibGDX ImageButton resizeing

How can I resize ImageButton ? It show very big on screen . How I know it is an Actor and it is not resizing automatically . I can`t find the method for resizing it. Any ideas?
0
votes
1answer
110 views

How to keep track of previous scenes and return to them in libgdx

I have three scenes: SceneTitle, SceneMenu, SceneLoad. (The difference between the title scene and the menu scene is that the title scene is what you see when you first turn on the game, and the menu ...
0
votes
1answer
98 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
0answers
135 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
35 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
0answers
49 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 ...
1
vote
1answer
342 views

html5 libgdx project: war to be deployed in a servlet container or only part of the contents to a web server

I am new to compiling games with libgdx to be played on the web and I have some doubts perhaps someone can point me in the right direction: Using the new gradle setup I wrote a simple game to learn ...
0
votes
1answer
122 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
99 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: ...
1
vote
0answers
67 views

libGdx Window .pack() not working

I'm trying to make a window, then use the pack method to get the right size, but the window maximizes instead. Here's my code: private Table buildOptionsWindowLayer() { winOptions = new ...
1
vote
3answers
238 views

What datastructure would you use for a collision-detection in a tilemap?

Currently I save those blocks in my map that could be colliding with the player in a HashMap (Vector2, Block). So the Vector2 represents the coordinates of the blog. Whenever the player moves I then ...
0
votes
1answer
131 views

Combining pathfinding with global AI objectives

I'm making a turn-based strategy game using Java and LibGDX. Now I want to code the AI. I haven't written the AI code yet. I've simply designed it. The AI will have two components, one focused in ...
1
vote
1answer
298 views

Box2D body rotation with setTransform

I' having a problem rotating a body with setTransform(), The body has multiple sensors that should rotate with the player. The rotation works but it rotates around the bodys local 0,0 position instead ...
1
vote
0answers
64 views

LibGDX: Why look BitmapFont pixelated on a scene2d.ui.Dialog?

When I use BitmapFonts directly on the stage table, the fonts looks normal (not pixelated). But when I use the same BitmapFont with the same size on a scene2d.ui.Dialog, the font looks pixelated. ...
1
vote
1answer
169 views

libgdx get rotated sprite coords points

I would like to get the position of each edge of a sprite when he has been rotated. I have no idea how to do it, I made a image to explain it. I would like to get the X and Y position of each Red ...