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

2
votes
2answers
595 views

Change the scale-policy of OpenGL ES in Android?

I currently develop a game for Android in OpenGL ES 1.0, use libgdx library. I target the 720x480 screen size. For example, I design only one arts pack for 720x480. And what will happen in Android ...
1
vote
1answer
51 views

Libgdx Get Font Height with a Wrap

is possible to get the 'Height' of a font drawed with the drawWrapped methods (with a wrapWidth) ? getMultiLineBounds only works when \n is used, but when drawing with drawWrapped it doesn't give the ...
1
vote
1answer
75 views

How to make platforms spawn without touching other platforms

So I am making a doodle jump like game where there are platforms scrolling by but right now how I have platforms spawning is completely random. I would like the platforms to be spread apart so they ...
-1
votes
1answer
39 views

Stop diagonal selection in my Match-3 game [duplicate]

I have a matching game where the user drags their finger over items to select them. The problem is, i only want the user to be able to select items by dragging vertically or horizontally, not ...
5
votes
5answers
4k views

Why do I get this file loading exception when trying to draw sprites with libgdx?

I'm having trouble with the "Drawing Images" section on the libgdx tutorial. I set up the documents completely and I typed the code as follows: public class Game implements ApplicationListener { ...
1
vote
0answers
81 views

How should matrix-based Parallax Scrolling work?

The question is at the end, as it requires a bit of context. I'm not sure if my understanding, my code, or LibGDX's ParallaxCamera is wrong. LibGDX's ParallaxCamera uses Matrix4s to achieve a ...
0
votes
0answers
20 views

How do I scale and rotate around different points in Libgdx? [duplicate]

I'm using a SpriteBatcher to rotate and scale a TextureRegion in libGDX. I'd like to rotate the texture around an origin outside of the region, but have the texture scaled around the region's center. ...
0
votes
2answers
943 views

Using LibGDX within Android Fragment

I want to use LibGDX with Android, but instead of modifying my Activity to extend AndroidApplication I want my to render my graphics inside Android Fragment The problem is that my class ...
0
votes
3answers
112 views

Why is my texture drawn in a different place when in fullscreen?

I'm trying to draw a texture (with a crescent moon) in the middle of the y-axis: public void draw(SpriteBatch batch) { batch.draw(lune, 0, Gdx.graphics.getHeight() / 2); } It renders this when ...
1
vote
0answers
475 views

LibGDX RPG walking animation [closed]

I've been trying to nail down a walking animation with libGDX. I'm making an RPG with the character that can move up, down, left, and right. I have this movement in a spritesheet. I've been ...
0
votes
2answers
149 views

LibGDX Android version

I am trying to use the LibGDX UI Project creator to create LibGDX projects, but it doesn't allow me to choose the Andorid version for the project. This is a problem for some android features. For ...
0
votes
1answer
111 views

Units, Layers, and Isometric Ordering

I'm currently using LibGDX and Tiled map editor to render isometric maps. I'm having a two related difficulties. The first issue is, when do I render units that will end up changing position often ...
0
votes
2answers
2k views

Handle Input Processor in Device Back Button and Button as Actor

How to handle a event for both key as well as actor added in the screen? My problem is that at a time only one input processor is available either for button or device back button. How can I set input ...
0
votes
0answers
16 views

LibGDX MVC - Where I should put resources [duplicate]

I want to use a MVC pattern to develop a small Game like SpaceInvaders. But dont know, wether I unterstand this pattern right. First of all, I try to explain how I understand this pattern. Model: ...
2
votes
2answers
919 views

How can I convert a tilemap to a Box2D world?

I want to use Box2D physics and lighting with a .tmx map. How can I "convert" a tilemap to Box2D world? My basic idea is to go through the tiles on the map and create an object for them in Box2D. I'm ...
5
votes
2answers
126 views

How to make part of the Texture not to be scaled.?

I am new to LibGdx, i was doing one example for my learning and struck with this question, i had searched in google but i am not able to find the answer for this. 1) How to make part of the Texture ...
0
votes
1answer
101 views

isometric coordinates issue: (0,0) and (5,5) are flipped?

I am having an issue with the isometric coordinates. When I enter the coordinates (5,5), the character should be at the bottom corner of the tile, but it is at the top corner, (5,5) and (0,0) look ...
0
votes
1answer
131 views

LibGdx Android Phone Resolution problem

I am using the LibGdx framework and have an issue. Currently, I am creating a game in a resolution of 480 x 320 and using 'GL20' to remove the restriction of that dreaded 'power of two' error. It ...
0
votes
0answers
18 views

libgdx : Scrolling background from spritesheet causes lag when sprite is repositioned… am I doing something wrong? [duplicate]

So, I use a sprite from a spritesheet to draw the background and repeat it. (I am drawing it twice) However, the moment that the background is re-positioned to make it look infinite, it causes a lag. ...
0
votes
2answers
52 views

libGDX map transition via try & catch exeption

I have a simple question. Some explination first, however: I am using libGDX and making a Legend of Zelda-type top-down game and I'm having an issue with map transitions. When I made the tilemap ...
0
votes
1answer
46 views

One InputProcessor for two controllers

On my screen I want to display two controllers, one to turn around the character (We'll call itLook) and one to move the character (We'll call it Move). I have a line registering a ControllerListener ...
0
votes
1answer
70 views

Trying to make sprite float up and down [closed]

Using LibGDX + Box2D and my understanding of the answer posted from this question: Here I apply the following impulse: // modify sprite's Box2d Body object int a = 8; // amplitude int f = 1; // ...
1
vote
2answers
2k views

LibGdx drawing weird behaviour

I am finding strange behaviour while rendering TextureRegions in my game, only when pausing it. I am making a game for Android, in Java with LibGdx. When I comment out the line "drawLevelPaused()" ...
2
votes
2answers
136 views

How do I create a horizontally centered “gravity line”?

Here's my ideal scenario: A game object (in blue) can change its horizontal velocity, but it will be pulled back by gravity (dotted gray arrows) toward a central vertical line (in red). How can I ...
0
votes
0answers
53 views

Shadow wall sight problems

i used this tutorial https://github.com/mattdesl/lwjgl-basics/wiki/2D-Pixel-Perfect-Shadows to make my shadows. I think its a pretty nice and easy method. I render all my shadow in a Framebuffer and ...
0
votes
1answer
85 views

How could I control an air hockey 's AI paddle?

I am making an air hockey game on Android with Box2D and libgdx. For the manual control, I just use the MouseJoint and it works perfectly. However, for the AI control, there is a problem: I've made a ...
1
vote
1answer
239 views

ParticleEffectPool.obtain() not resetting particles

I want to use ParticleEffectPools in libGDX but I'm running into an odd issue where the effects don't seem to be reset when obtained by the pool. The code below looks for an existing ...
0
votes
0answers
45 views

Sound Effect Delay occurs when game is deployed with GWT backend?

I've been posting my games on to my personal website recently and I noticed a slight hiccups with the LibGDX games I've made. Within the first few seconds following the loading of the game, there is a ...
2
votes
1answer
133 views

Libgdx - Collision position - Box2D

I'm actually developping my own game but i'm facing a little problem. I trying to figured out how to get the position of a fixture (collision) between two entities. For example this : ...
1
vote
2answers
675 views

Gesture Detector not firing

So I'm trying to create a input class that implements a InputHandler & GestureListener in order to support both Android & Desktop. The problem is that not all the methods are being called ...
3
votes
3answers
204 views

How can I support retina graphics in libgdx?

I'm not sure if I'm missing it somewhere or if this just doesn't exist, but I'd like to support "retina" graphics on desktop displays that support them (like the newer MacBook Pro), but I can't find a ...
0
votes
2answers
123 views

Box2D Libgdx removing bodies in case of simultaneous collisions

I am making a clone for the BreakOut game. I'm using Box2D and Libgdx for it. In the game, one scenario is that there could be 2-3 balls at one time. Now the problem occurs when 2 or more balls ...
0
votes
1answer
40 views

libgdx get the value of a key

I'm trying to do collision detection (which I have working well) but now I want to use it for a little more. I want to check special circumstances for the collision. Right now I'm checking for ...
2
votes
4answers
1k views

Hide collision layer in libgdx with TiledMap?

I'm making a 2D game with libgdx, and I'm using its TileMapRenderer to render my map which I have made in the map editor Tiled. In Tiled I have a dedicated collision layer. However, I can't figure out ...
1
vote
2answers
81 views

How can I find all connected objects of the same type recursively?

In my game, when a user selects an object of some type, I'd like to search for all other objects of the same type that are connected to that first one. For example, if the user selects a object of ...
1
vote
0answers
86 views

LibGDX polygon caching

I am developing an Android game using LibGDX and I have big world map made of polygons. I use PolygonSprite and PolygonSpriteBatch, when I render map, I get 30-35fps and it feels laggy. I wonder if ...
0
votes
0answers
23 views

Make QueryAABB touch in the center of a body to respond

I am allowing the user to drag their fingers to select bodies. The bodies are then added to a array list to be removed later. The problem is, i would like the users finger to have to cross the middle ...
0
votes
2answers
83 views

How do I show a Quit button on Desktop but don't show it on Android with libgdx?

So I would like to display a Quit button on the Desktop main menu screen, but I wouldn't want to have it on Android too. What is the correct approach to achieve this? Do I have to check the ...
0
votes
0answers
57 views

Adding Sprite in 3d scene?

I want to add sprite in 3d, with object load with .g3db, I read some of topics here how can I use, but there is problem batch.begin(); Gdx.gl.glEnable(GL10.GL_BLEND); ...
0
votes
1answer
55 views

Universal Tween Engine: are accessor hierarchies possible?

Background: I'm using Universal Tween Engine, which allows generic accessors to be implemented to permit tweening of arbitrary atttributes. I have a hierarchy of game entity classes that share a ...
2
votes
2answers
74 views

Why aren't resources such as Pixmap disposed on finalization in LibGDX?

I've been looking at the LibGDX framework, and certain classes such as Pixmap require to be disposed manually when you are no longer using them (call the dispose method). I'm wondering, since this is ...
2
votes
2answers
113 views

Isometric objects are mapped incorrect angle, but the map is fine. What am I missing?

I laid out my iso map and it's fine, but when I add my sprite actors they get located in the correct location but they are laying down not standing up. I tried rotating them on the z by 45 but then ...
1
vote
1answer
315 views

Using Unity 3D in LibGDX

Is it possible to use Unity 3D engine with LibGDX when making Android game apps? Is it also possibly used for making 2D games using Unity 3D and LibGDX? I would like to know if it's possibly ...
1
vote
1answer
106 views

How can I kill a libGDX AsyncTask immediately?

Is there any way of killing a running AsyncTask immediately in libGDX? The AsyncExecutor that submits it seems to just have one method (dispose()) that kills all the AsyncTasks that it handles after ...
0
votes
0answers
52 views

Getting nearby entities with flixel-gdx

What's the easiest (while at least somewhat efficient) way to get FlxObjects within a certain range of a point or other FlxObject? e.g. I'm a monster NPC, are there any units within range I should ...
0
votes
0answers
28 views

PolygonRegion creating anr

I'm try create mask for cut texture. User moving finger on the screen and when he will up finger mask will created. My problem in, after user has long time moved on screen and up finger, mask start ...
0
votes
1answer
63 views

How can I adjust the UVs of my quad so my texture isn't flipped?

My sprite geometry is reversed using matrix so that it is in the XZ plane. This results in the image used for the sprite to also be reversed, which I don't want: (source : ...
1
vote
1answer
1k views

LibGDX Drawing sprites when moving orthographic camera

I've been having this problem for a long time and I just can't seem to find the exact problem. I have a game where the map is 480x1600 and my camera has a view of 480x800. I have a button that when ...
0
votes
1answer
211 views

Why does resizing my game window move and distort my rendering?

I'm starting to make a game, and the first screen I've made is a very simple loading screen with some centered text. On starting it up, the text is nicely centered: Then I resize the window, and I ...
0
votes
1answer
128 views

How do you do FlashPunk-style animation in libGDX?

In FlashPunk, you can have multiple animations set, and then choose which one to play at any time, and it'll do it. Example: animatedSprite.add("running", [0, 1, 2, 3], 50); ...