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

Cylinder scrolling / wrap-around world using shaders?

I am making a 2D game using OpenGL ES 2.0 (libgdx), where the world will wrap-around itself on Y-axis. Apart from implementing the "modulo" method in my rendering code, I'm wondering whether it's ...
1
vote
0answers
59 views

Need to join 2 bodies via weld joint but not on center of mass

I have successfully join 2 bodies via weld joint , but my problem is I want to join corners of bodies not on centre of mass. Is there any way to achieve this? Above image consist 3 polygon body that ...
7
votes
1answer
166 views

Problem when scaling game screen in Libgdx

Currently, I'm able to scale the screen by applying this bit of code onto an OrthographicCamera Camera.setToOrtho(true, Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2); But something ...
1
vote
1answer
236 views

Movement of body after applying weld joint

I have two rectangular bodies. I've applied Weldjoint successfully on these bodies. I want to move that joined body by applying linear impulse. After weld joint, these two bodies becomes single body ...
4
votes
1answer
1k views

Confusion with Libgdx UI

I've started with Libgdx and am currently stumbling about trying to understand how to set up the interface. I have generated the base projects in Eclipse ( < proj-name >,< proj-name >-android, ...
1
vote
1answer
129 views

Pixmaps, ByteBuffers, and Textures…Oh my

My ultimate goal is to take a specific region of the screen, and redraw it somewhere else. For example, take a square from the upper left hand corner of the screen and redraw it on the lower right ...
3
votes
1answer
2k views

When to use ShapeRenderer & SpriteBatch in libGdx?

As a beginner(in GdxLib+Android), i found that for rendering particular screen, we can render that using both ways then when to use specific ones? & What is the best option for Updating the ...
-1
votes
1answer
344 views

libgdx intersection problem between rectangle and circle

My collision detection in libgdx is somehow buggy. player.png is 20*80px and ball.png 25*25px. Code: @Override public void create() { // ... batch = new SpriteBatch(); playerTex = ...
10
votes
3answers
10k views

Resolution Independence in libGDX

How do I make my libGDX game resolution/density independent? Is there a way to specify image sizes as "absolute" regardless of the underlying density? I'm making a very simple kids game; just a bunch ...
0
votes
0answers
27 views

libgdx loading textures fails [duplicate]

I'm trying to load my texture with playerTex = new Texture(Gdx.files.internal("player.jpg")); player.jpg is located under my-gdx-game-android/assets/data/player.jpg I get an exception like this: ...
0
votes
1answer
358 views

coloring box2d body in LibGDX

I want to color polygon of box2d in LibGDX. Found below useful class for that. http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/glutils/ShapeRenderer.html But, it is not ...
1
vote
1answer
60 views

All libGDX input statements are returning TRUE at once

I'm fooling around with Box2D and libGDX and running into a peculiar problem with polling for input. Here's the code for the Screen's render() loop: @Override public void render(float delta) { ...
1
vote
1answer
208 views

Why doesn't RGB565 lead to a smaller memory footprint on Android?

I'm using LibGDX for my game. I'm loading 9 bitmaps into memory at once using the AssetManager, about 512x512 pixels each on average. TextureParameter texParam = new TextureParameter(); ...
2
votes
5answers
1k views

How to Make Objects Fall Faster in a Physics Simulation

I used the collision physics (i.e. Box2d, Physics Body Editor) and implemented onto the java code. I'm trying to make the fall speed higher according to the examples: It falls slower if light object ...
2
votes
2answers
763 views

Libgdx OrthogonalTiledMapRenderer not rendering map properly

I'm using a little hack to change the coordinate system to the one i'm accustomed to (left and up is negative and right and down is positive) but this causes the tiled map renderer to render the map ...
0
votes
1answer
240 views

Using native code with Libgdx, (Raknet)

I was searching for a game engine (Java- maybe C#) with built-in real time networking library to develop 2D cross platform (Android - iOS) multiplayer game. Actually I have not found well suited ...
0
votes
1answer
281 views

How can I get animated bone's transformation in LibGDX?

I am trying to get transformation from a bone, but i can't, I exported just a animated armature with just a bone from blender, then I converted to .g3dj, so I just need the bone transformations so ...
2
votes
2answers
735 views

How do I get the touch event on a body in Box2d(Java)

I have various bodies rotated at some angle with the help of Box2d in libGDX. What I want is to destroy the body when I click on it, but the problem is that I am not able to get the area definition of ...
0
votes
2answers
153 views

Libgdx InputListenner not working

I've added an InputListener to my libgdx actor and I've added the actor to the stage. The stage (and all of its actors) gets drawn just fine. The problem is my actor doesn't seem to be receiving ...
2
votes
0answers
99 views

Unproject considering parallax depth

How can I take screen coordinates (or alternatively world coordinates on the 'primary' parallax plane) and find out what world coordinates they translate into when taking parallax depth into account? ...
2
votes
1answer
412 views

box2d raycast filter category

I am trying to filter a category in my ray casting (jBox2D within libGDX), which should return the closest object that does not belong to the category LEVEL0. I've tried a plethora of approaches, but ...
0
votes
0answers
108 views

Rendering tile maps for mobile devices

Hitting a bit of a roadblock with my game's development and I'm just looking for some outside advice. I'm trying to render a tilemap for my mobile game (Android) and I'm using LibGDX. Now, here's ...
4
votes
2answers
586 views

LibGDX stretching 2d graphics

I have a problem with stretching sprites in LibGDX. I have one png file for the sky in the game (1 x 1000px) and I want to render it 1000 x 1000px sprite.setSize(pixelWidth,pixelHeight); I want to ...
5
votes
1answer
328 views

OpenGL ES 2.0 obscured texture is visible

Hi, I am using LibGDX and OpenGL 2.0 to create a game. So far I have created two meshes. The front mesh is the one with the brown circle texture and another mesh on the top with a green to white ...
1
vote
2answers
132 views

When input listener set in resize(), input doubles

I created a button and assigned an input listener in the resize() method of the screen. For simplicity's sake, whenever I press the button, 1000 adds to a total amount. The weird part is, it adds ...
0
votes
2answers
692 views

Detecting key press only once [duplicate]

Have a question on keyboard inputs. Currently I am using this method to read my input, Gdx.input.isKeyPressed(Input.Keys.A), it is working fine. But I do realized at times there are multiple instances ...
0
votes
0answers
140 views

Error when create FrameBuffer: GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS

I'm using libgdx, to create some program. I need used some operation in framebuffer. For this operation I create new framebuffer, after this operation I'm call in framebuffer dispose(). When I create ...
0
votes
1answer
166 views

Remove a body when touched in LibGDX(Box2D)

I am using LibGDX to create a new project. What i am trying to do is, i load bodies from a tmx file into levels which works fine. The bodies also has a sprite with them. The problem is, is i would ...
3
votes
2answers
976 views

How to detect a touch on transparent area of an image in a (libgdx) stage?

Can some one please help to detect a touch on an image which I am using as an actor in a stage. The image is actually a long diagnol brush which has plenty of transparent area. The problem is when I ...
0
votes
1answer
48 views

libgdx fixture is giving unresponsive error

need some support. I am novice in libgdx game engine. Below is my code package com.game.box2d.fruitcart; import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; import ...
1
vote
0answers
87 views

LibGDX drawing portion of tmx map

I am trying to make a tile based game in LibGDX and I have run into some problem. In earlier versions of LibGDX you were able to draw a certain section of a .tmx map instead of a whole and even a ...
1
vote
1answer
309 views

rendering transparent meshes in LibGDX

Building open this tutorial - https://code.google.com/p/libgdx/wiki/ProjectionViewportCamera I have constructed a class for generating polygon meshes. But i cannot figure out how to render semi ...
0
votes
0answers
309 views

libgdx - Getting Errors after New Project Initialization using gdx-setup-ui.jar

I'm using libgdx-0.9.8 Trying to figure out how to resolve these issues: The constructor LwjglApplication(Main, LwjglApplicationConfiguration) is undefined The project was not built since its build ...
4
votes
0answers
349 views

Advice on NPC architecture [closed]

I'm developing a 2D Zelda game with LibGDX in Java using TileD maps. I am now adding NPCs to the engine and I'm thinking about how to make them so it's going to be easy for me to add/edit their custom ...
1
vote
4answers
4k views

How do I save files with libgdx so that users can't read them?

Writing my game in libgdx, I arrived at the point when I need to save the player stats and the info of the levels. However, in libgdx it's not allowed to write the file inside folder of the ...
2
votes
2answers
643 views

how to design and develop game level(stages) [closed]

I need some expert opinion about game level design. I've been developing android game(2D) using LibGDX framework inspired from below sample game. LibGDX sample Drop game I've customized this game ...
2
votes
2answers
324 views

How to implement pathfinding in this situation

So I'm creating a game for android using the libgdx library. I render the map from a tmx file and in it all the water tiles have the property of blocked. My player(a sprite) moves to where I ...
1
vote
1answer
493 views

Moving bounding box in 3D using Libgdx

How do i go about moving a bounding box in libgdx? I want to make the bounding box capture my character and move with him. So ideally i want to be able to copy my vector 3 from my model instance and ...
-1
votes
1answer
390 views

Different Attack Systems in RPG [duplicate]

I'm making a 2d rpg game with libgdx and java, and I'm wondering how I would organize different attack systems - magic, melee, etc. (it's not a turn-based rpg). I have a PlayerClass enum, a Player2D ...
6
votes
0answers
235 views

Box2D strange collisions (jitter) on sharp edges [closed]

I'm currently developing 2D side scroll game with Libgdx + Box2D. And I'm facing some problems with ChainShape (the ground) and PolygonShape (the cart body) collisions. Please look at this video: ...
0
votes
0answers
161 views

Box2D revoluteJoint Motor speed,Max torque scaling for diff Devices

Hi i am using Box2d Revolute Joint as a joint for wheel it's connect to Wheel and Body of my Car i am using RUBE for creating the Box2D world Prob. i am using a scaling floating point number to scale ...
0
votes
1answer
158 views

swipe effect problem using only mesh and array - libgdx

I tried to combine matdesl's and libgdx's draw lines algo ang code. but i can only create a line. problem is i want to make a fruit ninja swipe effect but only knows this... problem is i want to make ...
1
vote
1answer
255 views

Dealing with “jumping” sprites: badly centered?

Thing is, I've used darkFunction Editor as a way to get all the spriteCoordinates off a spriteSheet for each individual sprite, and parse the .xml it generates inside my game. It all works fine, ...
2
votes
6answers
3k views

Port libgdx application to iOS

I made my game using libgdx which is a cross-platform framework which supports desktop, Android and html5 (using Google Web Toolkit). What could be a possible route to port my game to iOS?
2
votes
1answer
228 views

LibGDX Scene2D event handling and bounding box relative to the center of a TextureRegion

I'm experimenting with Scene2D to see if it fits fot the game I want to develop. Say I have an Actor with the origin in the center of its TextureRegion. My setup method contains this code: float ...
0
votes
1answer
1k views

Libgdx explain steps for beginner to create and use image as a box2d body [closed]

I am basically from corona background and new to LibGdx , familiar with stage and actor from scene2D. Now wants to use physics body from box2d in the game besides using actor from scene2D. But I ...
0
votes
1answer
640 views

Side Menu using Libgdx

I want to make it so that when the player presses start, a side menu slides out and gives a player some option on one side of the screen, similar to Angry Birds or Pokemon. I'm not sure how to go ...
9
votes
2answers
712 views

What files of libgdx can I ignore on git?

In libgdx auto created project, What files can I ignore on Git (or another revision control system)? E.g Should I ignore: *-android/.settings/ *-android/bin/ *-desktop/.settings/ *-desktop/bin/ ...
0
votes
1answer
326 views

Movement with box2d using libgdx

I am pretty new to using physics engine and would like to know what is best practice for movement of playercharacters. Currently I have a class called Hero that has a CircleShape and when the user ...
0
votes
0answers
27 views

Trouble loading .png file using LibGDX [duplicate]

I'm trying to load a Texture to libGDX and I'm getting a file not found exception. Here's the code that's trying to load the .png file. ` //Textures private Texture tiles; private TextureRegion ...