LibGDX input y-axis flipped
I’m writing a game in Java for Android using LibGDX, and I connected my phone so I can test it on it. I know that LibGDX’s render system works different than regular Java systems since the 0,0...
View ArticleHow to move objects in any direction by swiping with libgdx android game...
first of, I’m new to android game development so I don’t know all the classes and dictionaries within android and libgdx. I’m actually following a game development tutorial for the first time...
View ArticleDoes libgdx implement the game loop for you?
Initially, I assumed that the developer has to implement the game loop because libgdx is a library – not an engine. But then I found out that Graphics has getDeltaTime() and getRawDeltaTime() so I...
View Articlelibgdx continuous movement while touch and hold (even after jump)?
So, I have these buttons where I have implemented a method to handle ‘touch and hold’ (without polling). If the player touches and holds the walk button ..it will keep walking till the button is...
View ArticlelibGDX: Why doesn't Gdx.input.isKeyJustPressed() work?
I’m trying to use the method Gdx.input.isKeyJustPressed() to check if the Android BACK button was just pressed. I don’t want to use the Gdx.input.isKeyPressed method to avoid multiple calls. Here is my...
View ArticleHow to “pause” stage actors listeners
I have a problem with multiple stages and listeners in libGDX. I have GameScreen with gameStage (contains game elements), uiStage (score label and pause button) and pauseStage (resume, restart and exit...
View ArticleError in projecting coordinates from FitViewport to screen in LibGDX
i’m using a FitViewport to render my “game world”. Viewport virtual dimensions are fixed 400×240. I use viewport.unproject method to scale input touches from screen coordinates to world coordinates,...
View ArticleScale smaller resolution to full resolution libGDX
Short question about the scaling in libGDX. At the moment i have a application with the resolution 480×320. I define this in the main method of the desktop launcher. My whole application is now...
View ArticleHow do I reverse this function?
I’m working on an isometric tile rendering engine and I need to reverse a function I used to translate the Cartesian coordinates into isometric coordinates. I’ve already written a function for this,...
View ArticleDoes the LibGDX AI extension work on IOS?
Does the LibGDX AI extension work for IOS? Here it does’t show how to add it to the IOS dependencies. I don’t have an IOS device but I want to release my game for IOS. I just don’t to finish my game...
View ArticleGLSL 2D Silhouette
I’m trying to render a silhouette of any entity behind foreground objects to indicate their position to the player. Here’s an example of what I want to achieve, from Hyper Light Drifter: From what I’ve...
View ArticleLibgdx using Box2d with TiledMap to create collision detection
I’m fairly new to Libgdx and have some good basic knowledge on Java. Right now I am stuck on how to add collision to my TiledMap, I am using the Mapeditor to create the tilemap. I read so many...
View ArticlelibGDX: Linking 3D scene from 2D screen
Using libGDX I have created a few 2D screens, such as a splash screen and a main menu, and also created a 3D scene which I want to be able to load when clicking a button on the main menu. I know how to...
View ArticlePlaying with hashmap in drawing
I’m developing a game in Java for Android, using LibGDX. In my render(), between the batch.begin() and batch.end() I’m running through all the game objects and draw them. Every game object is stored in...
View ArticleHow do I query a LibGDX Box2DLights “light” and “dark” regions?
I have lighting implemented using Box2dLight. I want to update/render things inside the player’s PointLight area. Stuff in the dark area should not be rendered. How can I find which areas are lit or...
View Article2D Collision Response
I am trying to implement collision response in my libgdx game. I’m using Rectangle objects as my bounbing boxes. This makes collision detection very easy, however I can’t quite get the response working...
View ArticleLibgdx coordinate system
I just started with libgdx and I’m still figuring out how the coordinate system work.The code below would draw the image at [0,0] without the Orthographic camera What I can’t understand is why the code...
View ArticleHow can I update a Stage-based HUD from another Stage's Actor in libGDX?
I feel like this is a simple problem, but I’m having issues finding the correct search terms. I have a Screen that includes two Stages. The first, stage, contains a number of objects deriving from...
View ArticleHow can I update a Stage-based HUD from another Stage's Actor in libGDX?
I feel like this is a simple problem, but I’m having issues finding the correct search terms. I have a Screen that includes two Stages. The first, stage, contains a number of objects deriving from...
View ArticleLibGDX: Easy way to draw partial sprites
I am surely overlooking something, but is there an easy to draw for example only half a sprite in LibGDX? I originally thought I could do this with setBounds() but this distorts the sprite.
View Article