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
vote
1answer
10 views

Libgdx--how to store every single point drawn using touchdragged?

Basically i am trying to detect line collision. The problem is when intersection occurs quickly(touch dragged is done quickly like fling), the collision is not detected. It seems as if 'touch dragged' ...
2
votes
1answer
41 views

Using Delta for a stopwatch, delta too fast than real time seconds

I search for methods to create a stopwatch on libgdx and came across with this: public void trigger(float delta){ playTime += delta; playTimeRounded = ((double)Math.round(playTime * 100) / ...
-1
votes
0answers
8 views

Libgdx Admob integration

I have successfully added the banner ad in my application. I have found that visibility is used for displaying and hiding ad. The ad loads every time whether it is shown or hidden. Is it possible to ...
3
votes
1answer
656 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
54 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 ...
2
votes
0answers
14 views

Why does adding LIBGDX “fadeIn” action to a table in a group make the whole stage fade in?

I'm trying to "fadeIn" a store "screen" which is really just an invisible group. I set the group to visible=true, set the alpha to 0 and then do a "fadeIn" on the group. The problem is that the whole ...
2
votes
1answer
44 views

How do I detect a line collison in LIBGDX?

I am drawing a continuous line using Pixmap. I want to check for a collision / intersection of my line with the already drawn line.
1
vote
2answers
35 views

How can I attach a libGDX actor to a box2D body?

I'm creating game like hill climb racing. I created my car with the help of shapes and joints but I don't know how to attach graphics to it. I used actors and sprites before for the sake of learning, ...
2
votes
1answer
56 views

Why do my Box2D collisions fail when I have multiple fixtures on one body?

I'm creating my first libgdx / Box2D game where a player moves around using a mouseJoint. My player has two fixtures, "main" and "question". For some reason when I have these two fixtures, my player ...
0
votes
0answers
24 views

rotate to movement direction [duplicate]

If I have a player character that can move 8-directionally, I can set the rotation of the player to face the direction of movement. But if I want to smoothly rotate to a direction, sometimes the ...
0
votes
1answer
324 views

Libgdx actor bounds are wrong

The Actor's boundaries are not centered at the ButtonText but I used the setBounds() method. The higher the Y position is, the less centered is the boundary. The weird thing is that i only created ...
1
vote
1answer
146 views

Design pattern for animation sequence in LibGDX

What design pattern to use for sequence of animation that involve different actor in libGDX. For example I am making a game to choose a wolf from a group of sheeps. The first animation played when the ...
1
vote
1answer
36 views

Texture Packer - Any way to make it combine intelligently

I am making a Pokemon Clone, using libgdx. I have the different types of sprites: e.g. Back, front, back shiny, and front shiny. The current way the Texture Packer combines the textures seems to be ...
1
vote
1answer
34 views

How can my entities avoid walking on certain tiles?

In my tile map, created with 'Tiled', I placed some tiles that need to be avoided by my mobiles. Tiles like water or obstacles. The entities "wander" in the map, choosing random directions, and their ...
-1
votes
0answers
18 views

LibGDX/Java - IllegalArgumentException causes my game to crash whenever my main character touches a Coin [on hold]

Trying to figure out why my Android game crashes whenever the player touches an animated coin. I have attached an image of the LogCat and my code is below (NOTE: all game objects in ![Renderer] are in ...
1
vote
1answer
174 views

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

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 ...
1
vote
2answers
800 views

How do you create fnt (angelcode format) files from existing bitmaps?

I often gets the same problem: Someones creates a nice bitmap font for me in form of a sheet nicely formated into a png, like this: ...and i need to create the angelcode .fnt atlas for using it ...
0
votes
1answer
63 views

Card game - creating card Listener

I am making a card game where there are 21 cards on hand and 2 options from where user can draw cards to his hand and throw a card from hand. I am new on game development and I'm following the ...
2
votes
1answer
57 views

box2d rendering performance degrading extremely even with sleeping bodies?

I'm working on my first smartphone game, a simple 2D platformer built with libgdx. Game maps use the Tiled level format, so a map is just a bunch of blocks. I recently started using box2d to implement ...
-1
votes
0answers
34 views

LibGDX - Is it worth making a World class for my game? [on hold]

Right now I pretty much have a World class across 3 classes (Player, Game, Renderer) if that makes sense? Game is where game objects are initialised, and Renderer just draws the objects onto the ...
1
vote
0answers
30 views

Libgdx implement 2d drop shadow for transparent sprites

I am a libgdx learner. For an learning application that I am developing using libgdx on android, I need to show drop shadow or glow effect when a sprite is touched. The sprites are created from a ...
1
vote
2answers
889 views

LibGdx sprite rotation vs Box2D physics rotation problem

LibGdx sprite rotation vs Box2D physics rotation problem Tearing my hair out on this one. I am an experienced software developer, but very new to LibGdx and Box2D development. I am writing a game ...
1
vote
0answers
37 views

How to eliminate the outline in libgdx?

I'm recently started working on a game in libgdx, and I've run into the problem that my sprites tend to get a thin, whitish outline around them. This is especially a problem for me since I'm working ...
0
votes
1answer
38 views

How do I split a button graphic into a 9 patch?

I understand what a nine patch is but I don't understand how to create one with code. I've made an image with a 1-pixel black border, but how do I turn that into a nine patch? How do I make a nine ...
2
votes
1answer
132 views

Does Libgdx being “for Desktop” mean dependency-free native executables?

I want to clarify whether the Java Framework "LibGDX" can be used to compile games to native executables. The description/tagline says "Desktop/Android/HTML5/iOS Java game development framework". I ...
0
votes
0answers
16 views

How do I get the impulse of a collision from Box2D in LibGDX?

I am developing a game using LibGDX and Box2D. I want to get the force or the impulse when two bodies collide, but I can't find the right way to do that. How can I use a ContactListener to get the ...
0
votes
2answers
87 views

Optimizing Collision Detection in a 2D Game

I am optimizing my "little" Java (LibGDX) shooter game, and perhaps unsurprisingly, collision detection is a "bottleneck"; I've kind of reached my performance goals already, but I want to tweak the ...
0
votes
2answers
1k views

SpriteBatch being drawn outside of Stage?

Currently working on my first game, though running into some problems with libgx and screen aspect ratio. What I have is a Stage which contains things like menu buttons etc, and the rest of the game ...
0
votes
1answer
41 views

Dealing with multiple 2d sprite animations for the same object

I am using libGDX for a 2d game. Some of my in-game objects have animations, for example a soldier in top-down view that has a walking animation. That is working fine. Now, while walking, this ...
0
votes
1answer
60 views

Make camera move constantly upwards in box2d world

Im using libGdx to develop a 2d game, which has the following: The world moves in an upward direction by having a camera follow the player's y position. The user only controls player's x movement, ...
-1
votes
0answers
13 views

What's the problem with ImmediateModeRenderer20 and ShaderProgram Initialization? [closed]

I tried the code from : https://github.com/mattdesl/lwjgl-basics/wiki/LibGDX-Finger-Swipe and i get those exceptions Exception in thread "LWJGL Application" ...
1
vote
0answers
27 views

Lag when drawing single Texture multiple times in libGDX [closed]

I am building a game where you are basically drawing little dots on the screen with the help of the accelerometer. I am using a single instance of an Actor where I store the coordinates that needs to ...
0
votes
1answer
106 views

Label not properly centered in TextButton

I'm using LibGDX v1.1.0 and I see that the label of a TextButton is not properly centered. I have the following code: m_resumeButton = new TextButton("resume", skin); m_resumeButton.addListener(new ...
0
votes
0answers
26 views

How to draw multiple large background images using libgdx?

I have developed a basic lunar lander-style game using Slick2D and dyn4j and am now redeveloping it using libgx for various reasons. I am having problems drawing the background (i.e. everything, but ...
-2
votes
1answer
50 views

Throwing a bomb LibGDX Box2D [closed]

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

AssetManager and Pixmaps

I've been reading about AssetManager here: https://github.com/libgdx/libgdx/wiki/Managing-your-assets. Apparently assets are reference counted (with load and unload). I am wondering about Pixmaps. ...
1
vote
0answers
103 views

How can I modify my procedural shadows to also show some of the walls?

I'm rendering shadows in Libgdx with the method from this tutorial. I think it's a nice and easy method. I render all my shadows in a framebuffer, then invert it. Before invert: After Invert: ...
0
votes
1answer
74 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
70 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
2answers
20 views

libgdx spect ratio not working on android

I have this method: public final float aspectRatioHeight(float originalW, float originalH) { float newHeight = (originalH / originalW) * (Gdx.graphics.getWidth()-20); return newHeight; } To ...
0
votes
0answers
30 views

How to create Game levels in LIBGDX android game [closed]

Can anybody Guide me. I need to Create Game levels in LIBGDX android game that I have created using kilobolt zombie bird tutorial that is here ...
0
votes
1answer
634 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 ...
2
votes
2answers
78 views

Entity/Component System - Unique Behaviour

So, I decided to see what the Entity/Component system of game development was all about. I really liked it. So, I decided to implement my current game with it. My problem: Unique Behaviour with the ...
-1
votes
0answers
30 views

Draggable tiled map with locations to klick on (libgdx) [closed]

I'm currently working on a tiled map with tiled. So I want to make it draggable and set positions where the player can click on. Then an event should be triggered. I need some instructions how to do ...
0
votes
1answer
80 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
1k 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: ...
0
votes
0answers
30 views

Seeking Advice: Collision with JBox2d for Top-Down or Isometric Maps

I Hope I can make this as clear as possible! Currently working on an action RPG game, very early stages, more just the basic ideas down and written in. So i'll start on with my setup: Using Java ...
0
votes
1answer
26 views

Libgdx: Android Facebook login with pure java code

I am integrating Facebook with my LIBGDX project and have everything setup (Facebook SDK, generated HashKeys, Facade pattern for platform specific Facebook API's, etc.). The Facebook dev tutorials ...
1
vote
1answer
233 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
237 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 ...