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

0
votes
0answers
22 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
30 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
30 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
22 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
19 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
34 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
40 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
59 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
40 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
85 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
24 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
78 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
28 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
38 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
35 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 ...
0
votes
2answers
53 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
49 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
28 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
20 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
59 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
182 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
186 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
56 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
50 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
81 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
40 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
153 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
28 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
86 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
69 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
154 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 ...
0
votes
0answers
14 views

Actions.fadeOut doesn't work when called on stage root

I'm trying to fade out my screen when a button is pressed, but the following code doesn't work: public void switchScreen(final Game game, final Screen newScreen){ stage.getRoot().getColor().a ...
2
votes
1answer
120 views

How can I draw multiple lines connected via “nodes” in libgdx Scene2D?

I have two Vectors which indicate the ending points of each line. I am trying to draw similar lines to football formation lines like these. My main problem using ShapeRenderer is: ShapeRenderer ...
0
votes
0answers
17 views

Unable to rotate an Actor using an Action in libgdx; what am I doing wrong?

I use this to add a rotate action to my actor: theme_button = new ThemeButton(theme); theme_button.setPosition(300, 300); theme_button.setSize(300, 300); theme_button.setOrigin(theme_button.getWidth()...
0
votes
1answer
31 views

libgdx collision on moving Rectangle with other Rectangle

I'm making a soccer game where you touch the screen and the player shoot the ball to the touched position with the objective of scoring goals when it hits the goal. The player is just a Sprite and the ...
1
vote
1answer
45 views

Shader only rendering 1/4th of the screen

I've asked the same question on SO here and they suggested I should ask here instead. I'm currently trying to create a gaussian blur shader, and while I've successfully created the blur effect my ...
0
votes
1answer
27 views

libgdx sprite placement

Im making a soccer game where you basically have to shoot the ball to the goal and the ball goes to where you touch the screen. Im having an issue with the ball though, when the ball spawns on the ...
0
votes
1answer
56 views

onHold input libGDX

I want to have onHold or onTouch input for my game. So as long as the user touches the screen something happens (a car moves) and when he stops touching the screen it stops. How do I do that? I want ...
1
vote
0answers
39 views

How to force libGDX to set display mode?

The following code represents my attempt to switch display modes. I've had to include the redundant setWindowedMode because without it, libGDX would not force the change required to reflect the ...
0
votes
0answers
14 views

Libdgx and Overlap2D export settings for Android

So I have a problem when exporting assets from Overlap2D to Android Studio project location. When setting up libgdx I set the project to be for desktop and android and selected Overlap2D extension. ...
1
vote
1answer
77 views

ScreenSize vs. WorldSize

While programming a game with LibGDX, I came across a problem. My OrthographicCamera wasn't centering in the right place. I was trying to center the camera by using the line of code: gameCam.position....
0
votes
0answers
6 views

LibGDX Child node is not following animation

So I'm trying to place a golf club as a child node of the hand of our "golfer", so it follows the animation the golfer has when the animation is invoked. However, once I hit "Check Swing" (the button ...
0
votes
1answer
69 views

Network interpolation wont work for local player

im currently developing a little duengon crawler. It should have lan multiplayer and it works great but i think im sending to much packets. Should i send packets over network, when a player moves in ...
0
votes
0answers
151 views

Box2dMapObjectParser isometric map - bodies have wrong position and size

I'm using Box2dMapObjectParser to load Tiled objects layer onto my IsometricTiledMapRenderer'ed TiledMap. It works OK with a UnitScale of 1 but the position is wrong and some shapes have weird ...
0
votes
1answer
78 views

How to split a screen in half using LibGDX without scaling?

I am currently working on a racing game with libGDX and I need to split the screen in half for a two-players mode. (Player 1 in first half and Player 2 in second half). I already have Camera1 that ...
0
votes
0answers
64 views

How to update projectile trajectory point?

I am a new game developer, I am making a game, but I have a problem, I don't know how I can update my trajectory point in OnDraw method. Could anyone please help me? Thank you! Here is my code: ...
1
vote
0answers
62 views

Libgdx stops all sounds when there are lots of sounds

I'm making a 2D game for Android using Android Studio with Libgdx in Java. I have a class, called SoundPlayer, which holds an ArrayMap. The key is the name of the sound file and the value is the sound ...