LibGDX is a cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux, Mac OS X, Android, iOS and your WebGL enabled browser.

learn more… | top users | synonyms

1
vote
1answer
40 views

LibGDx android : Show animation on button click

I am trying to create an application using libgdx where i need an animation to be played on pressing an image button, i've been able to achieve it using this code if(slapBossFlag==true) { ...
1
vote
1answer
27 views

LIBGDX font.draw() makes letters blink on PC

I load Bitmapfont then try to draw it, but on PC(desktop) build screen blinks with frequecy that I can judge that backbuffer is not drawn. On Android all is fine, I don't see blinking. I simply do ...
1
vote
0answers
7 views

Game freezing when i create a body Box2D Libgdx

I'm implementing a Worms game using libGDX and Box2D and I'm having a problem I didn't have until recently. When a player shoots, it creates a bullet body and applies a force to it. I have a step ...
0
votes
1answer
23 views

How to change the way LibGDX scales images?

I'm using FillViewport and OrthographicCamera. LibGDX is scaling my images rather badly - jagged edges, visible pixels. How can I change the scaling method? by the way, I'm pretty sure the issue isn'...
0
votes
0answers
7 views

Should I boost run task via disabling TexturePacker?

I decided to create textures with keeping in mind that the largest screen resolution that my game will be working with is 1920x1080. So, menu background texture in my game will be always 1920x1080. ...
1
vote
2answers
60 views

Should I have one asset manager and unload and load with different gamestates? Or should I have one for each gamestate?

I am working on a LibGDX game and I would like to find out the best way to manage assets. Should I have one AssetManager that is passed through to my GameState init() method to load from each level, ...
4
votes
0answers
136 views

How to correctly implement 'layered lighting' with Box2D-Lights

How does one only allow Box2D-Lights to affect one and only one OrthographicCamera. After researching, I found the following answer. This answer goes into detail about how to prevent one camera from ...
36
votes
5answers
8k views

How can I give the illusion of height to a ball in 2D?

In 2D top down soccer games, sometimes a ball is given the illusion of being in the air, like below: How can I achieve this?
0
votes
2answers
186 views

2D Platformer: add ability to jump on top of other character

I want to add ability to jump onto a head of other character/player, but still be able to go through them horizontally. There is one useful tutorial about one-way platforms, but that approach doesn't ...
0
votes
1answer
26 views

Sprite update issue

I'm currently implementing Box2D with LIBGdx and i'm having issue on update, as you can see on this video : https://www.youtube.com/watch?v=D3Nph6yftTQ whenever my player move or the camera move the ...
0
votes
0answers
32 views

Libgdx game doesn't work correctly after game over screen

So, I am trying to create a platform game for Android. As part of the game, I have created ladders that the hero is climbing. When he hits the enemy he dies, there is a game over screen --> touch to ...
0
votes
1answer
42 views

How to normalize angles from points in java

Previous thread on projectile slopes What is the velocity of a translating projectile in 2D? What I'm trying to do Get the slope at a constant speed for both X & Y Coordinates though I don't ...
1
vote
2answers
83 views

What is the velocity of a translating projectile in 2D?

What I'm trying to do. So I want to have a projectile that starts at point (x1, y1) and head in the direction of my mouse say point (x2, y2). To clarify I'm pretty sure it's a vector but I don't ...
0
votes
0answers
30 views

How can I make an animation in LibGDX?

In my game the player is running away from enemies and when he can't keep up the speed anymore I want the enemies to fade in from the side of the screen as the player is still running as show in this ...
4
votes
1answer
82 views

Move Sprite in constant speed on squircle

I'm creating a game and i need to move a sprite on squircle path. https://en.wikipedia.org/wiki/Squircle i created the path using the equation : angle -= Gdx.graphics.getDeltaTime()*speed ; ...
0
votes
0answers
28 views

libgdx box2d move object in bezier curv

I'm making a game and i need to move my game object in a bezier curv path i succeeded in doing it: //create Bezir curv .... path.valueAt(outMove, val); path.derivativeAt(...
0
votes
0answers
25 views

libGDX GWT compile with “-style DETAILED”

So basicly my libgdx HTML5-gradle build doesn't work. When switching from state it gives the following error: __gwt$exception: <skipped>: Cannot read property 'tM' of null Of course I want to ...
0
votes
1answer
35 views

How can I have margins or padding around a texture in libgdx?

I am building a game using libgdx a 2048 like game and I draw the tiles of the board using textures (each texture represents a tile with the number 2 or 4 etc.) I would like tohave a small space ...
0
votes
0answers
17 views

Hotplugging LibGDX

Trying to find a work around to getting hotplugging to work with LibGDX (the latest version seems still like it doesn't support it). Anyone know of something I could do to get joystick hotplugging to ...
0
votes
0answers
8 views

LibGDX Box2D Body shape transformation

In the following method my player Body is created: public static Body createPlayer (World world) { BodyDef bodyDef = new BodyDef(); bodyDef.type = BodyDef.BodyType.DynamicBody; ...
0
votes
1answer
53 views

Level Selection libgdx

I'm following the Canyon Bunny example in making my own game and I'm at the point where I want to implement a level selection screen. The way the example code works is that there's a Level class whose ...
0
votes
1answer
28 views

LibGDX Rotate 2D image with touchDragged() event

Objective: to rotate an image in the center of the screen with movement equal to left or right touchDragged event. Right now I have a basic Stage that is created and adds an actor (centerMass.png) ...
0
votes
0answers
23 views

Box2d Body filled with a texture Libgdx

I have a simple triangular shape (obstacle) in my game and i would like to fill it with a texture repeatedly. I have looked at the other 2 topics but couldn't find a working solution. How can i fill ...
0
votes
1answer
42 views

LIBGDX: Translate grid drawn with ShapeRenderer with an OrthographicCamera

I am trying to draw a grid for my "world" that may or may not extend beyond the screen. What I would like to do right now is draw the entire world (which is relatively small) and then use the ...
0
votes
1answer
49 views

How to remove white background from an image using LibGdx?

I am fairly new to game development. I am developing an application(Aquarium) for windows which requires me to animate(move) fishes around the screen and user will be able to add new fishes drawn on ...
0
votes
1answer
62 views

How to apply Buoyant force to a Box2d body?

I have been following a formula to calculate the buoyant force needed to apply to a dynamic body to be able to simulate water. Fb = ρgV Fb - is the buoyant force ρ - density of the liquid g - ...
0
votes
0answers
50 views

LibGDX works well on android 4 and very bad on android 5 and 6

I have a problem with my game. The game is made with libgdx, scene2d and box2d and it uses an AssetManager. I tested this app on all my devices and here it is the results: Galaxy S3, android 4 (...
3
votes
1answer
95 views

Just how expensive is it to bind textures in OpenGL? (LibGDX)

I'm using LibGDX on top of OpenGL and currently my game engine does something along the lines of the following per frame Bind a terrain texture sprite atlas and a set of transparency masks in ...
0
votes
1answer
25 views

Color aura around object in libGDXs actor

my question is, if there is some easy mechanism to create color aura around actor in libGDX? Thanks for all tips
0
votes
2answers
111 views

A single libgdx gamescreen with pop-up menu, getting ready, hud and game over?

Is it possible and practical to have only one screen, like a GameScreen class, where the menu, getting ready (plus instructions), hud (only score) and game-over screens can pop-up when needed. Can I ...
0
votes
0answers
34 views

Blur shader decals

Im trying to implement custom shader for decal GroupStrategy in libgdx, and I'm having some noob GLSL and OpenGL problems. I have implemented shader looking at this: http://xissburg.com/faster-...
1
vote
2answers
53 views

LibGDX Gravity and Jumping

I'm trying to implement gravity and the ability for the player to jump in my 2D LibGDX game. At the moment, I have two handlers: One for gravity and one for keyboard input @Override public boolean ...
0
votes
1answer
17 views

Scaling a single scalar using OrthographicCamera

I'm trying to convert a length (well, a radius) from world coordinates to screen coordinates using an OrthographicCamera. However, the only method I've figured out so far is to do a projection, with ...
0
votes
1answer
37 views

Random black screen when changing states

I'm making a game with LibGDX but I ran into a really odd problem. When I was working on the loading screen I delayed the loading process with an image of ~87MB. When the loading is finished, it ...
2
votes
2answers
67 views

LibGDX game crash without errors (maybe AssetManager)

i have a problem with my game. It's a endless run shooter/platform made with LibGDX (Scene2d and box2D). I do tests with LG G2, LG G3, Galaxy s4, desktop and android emulator and i have no one ...
0
votes
1answer
57 views

GLSL - Only draw arond point / flashlight effect

I'm currently trying to achieve a sort of flashlight effect in GLSL. I only want to draw textures within a certain distance of a specified point (the mouse position, for example). Here's a quick ...
0
votes
1answer
37 views

Libgdx - changing tiledmap smoothly, Tween engine maybe?

First question here, so bare with me if I make a mistake or two. Long story short I'm currently developing a side scroller game in java with libgdx, which uses tiledmaps from the tiledmap creator ...
0
votes
1answer
24 views

LibGDX - Shader not being applied

I've recently encountered a strange problem with my program and I can't seem to fix it. When I try to apply a shader to my SpriteBatch it doesn't change. I've debugged this problem like so: if (test) ...
1
vote
1answer
95 views

How to jump in Box2D with LibGDX

I am making a 2D platformer in LibGDX with both Ashley and Box2D. I have it so, that the PlayerControllerSystem watches for the jump key being pressed: // Jumping if (Gdx.input.isKeyPressed(...
4
votes
1answer
190 views

OpenGL(Libgdx) - How to texture a 2D terrain surface?

I want to texture the surface of my terrain. I have created the ground mesh and surface mesh separately and everything is okay for ground mesh. But I couldn't texture the surface mesh correctly. As ...
4
votes
2answers
201 views

Poor performance wth custom particle system in LibGDX

I'm using a custom particle system for my LibGDX / Java based game project (because I used Slick2D earlier on, need more parameters so I made my own and then ported). The system is fairly standard as ...
0
votes
1answer
69 views

How to check the memory leackage in libGDX game development?

I'm developing a multi-platform game in libGDX. Sometimes there is a huge issue with memory. The game used to stick a lot. In fact, I even used pooling. Is there any method to check the memory ...
0
votes
2answers
54 views

What is the difference between Sprite and SpriteBatch, specifically in the context of libGDX?

I'm using libGDX and I'm confused about the difference between the Sprite and SpriteBatch. Anybody can explain it to me in a simple way?
0
votes
0answers
92 views

Compiling libgdx game to iOS with BugVM - it launches libgdx Hello World app instead of my game

I'm trying to use BugVM (which is just a free open-source fork of RoboVM) to compile my libgdx game to iOS, but when it launches in iPhone simulator, it's not my game but the libgdx "Hello World" app: ...
1
vote
1answer
47 views

Libgdx black rectangles problem

I'm working on a game for Android using Android Studio with LibGDX in Java. I recently found a weird problem when closing and reopening the game. When I first open the game, it works fine. If I click ...
2
votes
0answers
215 views

Porting libgdx game to iOS using Multi-OS engine - how to add Admob ads

I want to port my libgdx game to iOS using Multi-OS (RoboVM is no longer available). I've searched whole internet but can't find any info about how to use Admob with Multi-OS engine on iOS. Every ...
0
votes
0answers
30 views

Splitting spritesheets and making the background transparent

Is there a quick way of splitting and removing the background of a spritesheet that's taken from the web? I'm fine with downloading software, using a website or making use of any commands that libGDX/...
0
votes
3answers
130 views

LibGDX simple button with image

I want to make two image buttons (play, restart) in my main menu screen but I dont know how to do it. I tried this: Texture playTexture = new Texture(...) Image playImage = new Image(playTexture) ...
1
vote
1answer
71 views

How do you create a funky moving background?

I'm trying to create something similar to what you would see if you loaded a song in Windows Media Player (the cool abstract background that moves and produces various colors). I have no idea how this ...
4
votes
1answer
171 views

RAM usage unusually high, but CPU usage relatively low

I've created a relatively simple game using libgdx, but the RAM usage when I start up the game on my Android device is roughly 600-700 mb, but the CPU usage is only about ~0.05%. I've downloaded a ...