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

2
votes
1answer
22 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
votes
0answers
15 views

TextureAtlas issue get texture

I have a texture atlas and I want to get a specific texture in it by name, but I get all textureAtlas with all texture. Why? This is the code: this.textureLeft= ...
0
votes
1answer
56 views

Tiledmap rendering [on hold]

I want to hide and make visible the tile map based on a condition, the tiledmap top is visible then I want to hide and then make it visible again I've implemented in the following way: //map object ...
-2
votes
1answer
45 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
26 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
0answers
15 views

Set 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
9 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
19 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
27 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
0answers
35 views

Handling in-game events/scripts in LibGDX?

I'm testing some RPG-like features in LibGDX, and having difficulty handling events (such as a sign that opens a text box with specific text). I have a basic prototype method to handle events, ...
0
votes
0answers
39 views

How do I make multiple buttons that are clickable? [on hold]

I have buttons in my game, I tried to use an InputListener then use the touchDown method but for some reason that only works with one button, all the rest don't work. So I am wondering how I would ...
0
votes
1answer
44 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
26 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
37 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
17 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
31 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
26 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
votes
0answers
16 views

AdMob Libgdx Full Screen Ad

favorite How can I make an AdMob ad in libGDX game ? For example I want to put small add at the bottom of some screens. but when the user loses I want to show a full screen add . any suggestions ?
0
votes
1answer
57 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
48 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: ...
0
votes
0answers
28 views

Use LibGDX 2d particle editor with text?

Is there an easy way to use text in the LibGDX 2d particle editor. I want to show a score with an animation. Or must I create for each text an image (and a ParticleEffect instance)?
1
vote
0answers
48 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 ...
0
votes
1answer
70 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
0answers
29 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. ...
0
votes
2answers
46 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 ...
1
vote
2answers
34 views

LibGDX . draw multiline text

I am trying to write a big text using BitmapFont in libGDX . But it shows on one line and the user can see only the first part of the text . How can I make that bitmapFont made new line automatically ...
1
vote
1answer
60 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 ...
2
votes
2answers
77 views

How to increase the acceleration of an object on the Y axis? [duplicate]

So far I am able to make the character fall at a constant rate but I am unsure how to make the character accelerate while falling. When the character is falling I have a line of code as such: ...
1
vote
0answers
24 views

Manage Admob Between Classes [closed]

I have a problem with ads because i want to disable the banner of ads in the game activity. I tried to use this guide https://github.com/libgdx/libgdx/wiki/Admob-in-libgdx#control but application ...
0
votes
0answers
29 views

Parabolic throw with set Height and range (libgdx) [duplicate]

Currently i'm working on a minigame for android where you have a rotating ball in the center of the display which jumps when touched in the direction of his current angle. I'm simply using a gravity ...
1
vote
0answers
69 views

2d libgdx: runtime level generation

I have encountered a problem during my first game development: I thought of a Array<Ground> groundArray that does groundArray.add when a new ground will appear on the screen, and removes oldest ...
1
vote
3answers
181 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 ...
1
vote
1answer
94 views

Libgdx 2D Game, Random generated World of random size, how to get mouse coordinates?

I'm a noob and English is not my mothertongue, so please bear with me! I'm generating a map for a Sidescroller out of a 2D-array. That is, the array holds different values and I create blocks based ...
0
votes
1answer
22 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
-1
votes
1answer
40 views

LibGDX Json not parsing full file

I'm trying to load a World with different Objects (World Objects and Entities). For that, I want to use Json. For less than two elements this works like a charm. But as I add more elements, some ...
-1
votes
0answers
30 views

rotate the image as finger move

I am facing a problem when rotating an image as my fingers move. I am getting a small deviation. Can anyone help me to resolve the problem in this code? public void touchDragged (InputEvent event, ...
0
votes
0answers
38 views

LibGDX - How to move Actor with fingers Code?

I am completely new to Game Development. I See all these Questions and Answers and Codes and I have no clue what to do with them. I need some Guidance. My Plan: I want my Actor to move up and down, ...
1
vote
1answer
74 views

Does scaling affect performance in OpenGL? [closed]

I've never been able to understand the best practice in this context. I usually want to ship my game with as minimum size as possible. So whereever possible, I try to use scaling of my graphics. Let's ...
0
votes
4answers
95 views

Accurate sprite rotation with mouse movement

I am using the current mouse position to aim the player sprite, but I am not getting the best results. It will often by off by a noticeable amount, or even a complete ~180 off if I go from one side, ...
0
votes
1answer
65 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
24 views

Cannot draw around the screen after zooming out with LibGDX projection coordinate

I've just started developing game in android using LibGDX. I've follow some samples and now my simple game can draw path when user move their finger around the screen. now problems appear when i add ...
0
votes
0answers
29 views

setRotation in touchDrag

I have a problem, have Actors that represent game pieces. What I'm trying to do is make it so the player can click-and-drag the tile to move it around one fixed position in the screen and rotate. I ...
0
votes
1answer
39 views

Swiching screen at collision LIBGDX

I am programming with LIBGDX and I am working with a piece of code. What I want to happen is that when the BUCKET collides with a DROP the game switches screens back to the menuScreen. I have tried ...
1
vote
2answers
53 views

Unable to draw single particle effect at two places

I am using Libgdx ParticleEffect to draw a fire particle effect . The issue I have is that when I try to render a ParticleEffect at two different locations within single game loop, only the last ...
2
votes
1answer
133 views

Is there a difference in these two ways of rendering sprites?

I use an OrthogonalTiledMapRenderer: renderer = new OrthogonalTiledMapRenderer(world.getMap()); and I wonder if there is a differnce between this call: renderer.getSpriteBatch().draw(sprite, ...
0
votes
1answer
86 views

Which input event is suitable for this game?

I am trying to clone this game: http://www.ferryhalim.com/orisinal/g3/bells.htm As i am using libgdx, so the game is both for Android and PC. I was wondering which input event would fit in nicely. ...
0
votes
1answer
17 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 ...
0
votes
1answer
38 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
62 views

Rendering tilemaps at a specific position libgdx

I'm making an endless side scroller game like gravity guy with libgdx. To test this I'm just creating two tiled maps with the same .tmx file to render then one after another, like: ...
0
votes
0answers
20 views

Transitive dependencies show up in desktop but not android project

I created a generic library (PB) which I'm referencing in my core project (mega-whack). Here's what the dependencies look like (simplified build.gradle): project(":pb") { dependencies { compile ...