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
16 views

Is it possible to create sqlite database only for android in LIBGDX game?

I want to know if I can just implement sqlite database for android in libgdx game? Also if this is not possible then may I know the simple way to integrate libgdx game to just store scores in sqlite ...
0
votes
0answers
3 views

Making dialog “clips” in libGDX or in general?

I'm new to libGDX (I just released my first game), and I've started thinking about things I'd like to do next time. One thing I really want to do is, have those story type movies, where you tap the ...
0
votes
0answers
5 views

Issues displaying images behind an inactive scrollpane

The background texture is only displayed when the scrollpane is scrolling, then it fades out to black. The text that is drawn displays fine in all cases. I don't know why this is, or how to fix it. ...
0
votes
0answers
10 views

How to loop through tiles in libGDX [duplicate]

I just need a for loop to show me all of the tiles in a tiled map. for(Tiles t: thetilemap) { }
0
votes
0answers
15 views

NullPointer calling scrollpane draw from a libgdx application

Solved: Using Stage to display rather than calling the ScrollPane draw method. I get this error when opening the GameScreen and calling the render method. Exception in thread "LWJGL Application" ...
0
votes
0answers
18 views

How to loop through all of the tiles in LibGDX [on hold]

I need to loop through all the tiles and use my personal collision class. How do I loop through them?
0
votes
0answers
17 views

Event handling for Pressing only 4 keys on desktop

I want to poll only 4 keys i.e. Keys.LEFT, Keys.RIGHT, Keys.Up and Keys.Down in libGDX strictly. That means, I want to call render method, only when above 4 keys are pressed. I followed below link ...
1
vote
1answer
22 views

how to remove game objects after on overlap in LIBGDX game

I have gold stars in my game that give score to game hero if the hero overlap with the star. What I want is to remove star once it overlap with hero object. I give score by checking overlap with this ...
1
vote
1answer
20 views

Drawing shapes and images in libgdx dialog

I am currently working on a dialog window for my android game using libgdx. This dialog window contains a collection of labels and buttons, but should also contain an image. The image represents the ...
2
votes
3answers
68 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
vote
1answer
17 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
0answers
17 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
49 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.
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 ...
2
votes
1answer
58 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 ...
1
vote
1answer
39 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
37 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
22 views

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

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

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

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 ...
2
votes
1answer
62 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
vote
0answers
36 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
0answers
40 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
2answers
89 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
1answer
43 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 ...
1
vote
0answers
28 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
61 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, ...
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 ...
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. ...
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 ...
2
votes
2answers
80 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
vote
2answers
40 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, ...
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 ...
0
votes
1answer
22 views

Libgdx screen keeping text on screen from main Game class

In my libGDX app I have some text running on the main Game class, and when I switch to a different screen the text is still there? Can anyone explain this please. Also in my main class it is changing ...
1
vote
1answer
29 views

LibGDX change screen after 2 seconds

Ive tried using a timer in the render method but that just crashes my game, so how do I change screens after a certain amount of time after rendering.
0
votes
1answer
39 views

Sprite rotation LibGDX

I'am using the current mouse position to aim the player sprite, but I am not getting the best results. I want my sprite to have the direction pointed wherever my cursor is in the screen. Here's my ...
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
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 ...
0
votes
1answer
24 views

Game info file? LibGDX android

In my app I need a file that I can keep settings like: TutorialSkip: True or AppDev: False and other info. How can I make this file and prevent users editing it? This has to work in the Core folder ...
0
votes
0answers
12 views

Box2DLight position seems to Floor

I am creating a top down game and i'm using raycasted lights from Box2Dlights, My light is all set up and working. its attached to the player's Body, and when the player moves, the sprite I attached ...
0
votes
2answers
38 views

Help Understanding libgdx create animations example game

I am trying to understand the example game, cuboc. GitHub is https://github.com/libgdx/libgdx-demo-cuboc. I have generated my texture atlas but I do not understand the code that uses this texture ...
0
votes
3answers
42 views

LibGDX: Making an object move correctly based on real time

Below is an image of my gameworld. As we can see, the player starts at position 0. each cell represents 1 game world unit. My goal is to get the player to move 1 unit (the red cell) in 1 second in ...
1
vote
1answer
37 views

Vertical Text - Bitmap Font Libgdx

How can I achieve this kind of rotation or vertical text using Bitmap Font? I already used Matrix but didn't get the result same as above.
0
votes
2answers
64 views

Placeing stones/tiles on a board game

I am a beginner at libGdx. I am building a board game (the Fanorama game). I would like to use a pic as the board and place the pieces on the board on top of the board sprite. Is there a nice way to ...
1
vote
0answers
19 views

Profiling my LibGDX game [closed]

hello programming friends, I have finished an Alpha version of my LibGDX game but it runs a bit choppy so it's time for me to start getting "analytical" and figure out exactly what's going on behind ...
0
votes
1answer
19 views

libgdx texture edge blending problem

I have two completely white bitmaps here: They're there, trust me. When I put one on top of the other and scale them down with TextureFilter.Linear I get this: How do I get rid of the dark ...
0
votes
1answer
26 views

LibGdx Input data in a textfield

I have a textfield using scene2d but don't know how to save user input. this is what i have and it just draws the textfield. txtUsername = new TextField("", mSkin); ...
0
votes
1answer
49 views

Box2D meters and pixels

I am confused about pixels and meters in Box2D. I know that Box2D work only in mters so I need SCALING FACTOR. How big I need it? For example I want that from my mouse coordinates position X and Y for ...
0
votes
1answer
57 views

Removing inline declarations makes code work. Why?

This does not work: camera = new OrthographicCamera(100, 100 * (Gdx.graphics.getHeight() /Gdx.graphics.getWidth())); This does: float w = Gdx.graphics.getWidth(); float h = ...
0
votes
0answers
12 views

Box2D thow ball from PIXELS posisiton

Here are my enemy movement function. I want that my enemy in random Y-position throw a bunch of things in to the player. And I want to implement physics using Box2D. But I know that Box2D workd only ...