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

0
votes
1answer
477 views

Changing the texture in a Sprite

I'm a bit new to libGDX. My problem is ,in my code, only if I set the texture in the constructor of the Sprite instance, it will draw anything. My question is shouldn't it be working when I only call ...
5
votes
3answers
1k views

Libgdx optimization of big arrays

I am working on a game using libgdx and I have the following code that I want to optimize. Array<Bullet> enemyBullets = Enemy2.getEnemyBullets(); for (Bullet bullet : enemyBullets) { ...
1
vote
2answers
189 views

Tween Animation Cannot Start

Do you have any reasons why my tween code didn't run or work? I already add the tween engine onto the library folder under LibGDX project folder and "Order and Export" it under Java Build Path at the ...
2
votes
1answer
366 views

Help on TileMapRenderer

In my project, I'm trying to render a map using TileMapRenderer. But it doesn't show anything when I render it. But when I use some other files from a tutorial they are rendered correctly. When ...
4
votes
2answers
739 views

Bitmap Font Displays in Center Always Without Coding it Manually (Fix Coordinate Problem onText)

Is there a way on how to stay the texts in center without manually coding it or something, especially when making an update? I'm making a display for the highest score. Let's say that the score is 9. ...
1
vote
2answers
344 views

Quaternion Camera

Can someone help me figure out how to use a Quaternion with the PerspectiveCamera in libGDX or in general? I am trying to rotate my camera around a sphere that is being drawn at (0,0,0). I am not sure ...
1
vote
0answers
473 views

libGDX using Stage and Actor produces different camera angles on desktop and Android Phone

libGDX using Stage and Actor produces different camera angles on desktop and Android Phone. Here are pictures demonstrating the problem: http://brandonyuh.minus.com/mFpdTSgN17VUq On the desktop ...
1
vote
2answers
678 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 ...
1
vote
1answer
391 views

Using Quaternion in libGDX

Can someone give me an explanation about how to use the Quaternion class in libGDX to move my camera around a sphere or just set it up, manipulate it, and apply it general? I am trying to acheive ...
2
votes
2answers
567 views

Error in destroying object in Box2D/LibGDX

I'm trying to delete an object when a collision happens. I have put the following code in the render method of the object so it would be outside of the physics calculations. public void ...
1
vote
1answer
850 views

Moving sprites on a graph in libGDX

In my game I'd like to move sprites on a fixed path. Until this point I was trying to stick with the tools already provided by libGDX, like the Tiled map renderer classes so I'm looking for a solution ...
2
votes
2answers
1k views

Move Camera Freely Around Object While Looking at It

I've got a 3D model loaded (a planet) and I have a camera that I want to allow the user to move freely around it. I have no problem getting the camera to orbit the planet around either the x or y ...
5
votes
1answer
570 views

Isometric - precise screen coordinates to isometric

I'm trying to translate mouse coords to precise isometric coords (I can already find the tile the mouse is over, but I want it to be more precise). I've tried several different methods but I seem to ...
2
votes
3answers
992 views

How to force a garbage collector swep on libgdx?

I found that you can control your memory usage on libgdx with: int javaHeap = Gdx.app.getJavaHeap(); int nativeHeap = Gdx.app.getNativeHeap(); But, How can I force a garbage collector cleanup? I ...
0
votes
1answer
155 views

SFX Played Once per Collision or Hit

I have a question about using Box2D (engine for LibGDX used to make realistic physics). I observed on the code that I've made for the physics here below: @Override public boolean touchUp(int screenX, ...
0
votes
1answer
198 views

Curiosity on any Smartphones that Run on Android 2.3.3 with Different Screen Reoslution

I have a question regarding about any smartphones that run only in Android 2.3.3. Is the size of screen or the screen resolution is always HVGA or does it have capable of running this OS (Android ...
1
vote
1answer
403 views

GestureListener's fling method doesn't get called

I'm using SimpleGestureDetector from the libgdx-users Wiki as my InputProcessor. I set it in the created() method: Gdx.input.setInputProcess(new SimpleDirectionGestureDetector(charController)); ...
1
vote
1answer
242 views

Precise Touch Screen Dragging Issue: Trouble Aligning with the Finger due to Different Screen Resolution

Please, I need your help. I'm trying to make a game that will drag-n-drop a sprite/image while my finger follows precisely with the image without being offset. When I'm trying on a 900x1280 (in X ...
1
vote
1answer
502 views

How to do geometric projection shadows?

I have decided that since my game world is mostly flat I don't need better shadows than geometric projections - at least for now. The only problem is I don't even know how to do those properly - that ...
9
votes
2answers
720 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/ ...
2
votes
1answer
606 views

Texturing a Sphere in libGDX

I created a sphere (planet) with a texture (earth texture) in Blender, and exported it using the G3DT exporter. Then when I go to use it in my application I convert to the G3D binary format, and load ...
0
votes
2answers
270 views

Wavefront mesh: determine which face a point belongs to?

I have a 3D mesh Wavefront .obj file. Is there any algorithm that takes an arbitrary point coordinates as input and determines which face of the mesh that point belongs to ?? The mesh is rendered on ...
2
votes
2answers
1k views

Keeping Aspect Screen Ratio While Stays in Center

I sqw and I tried this suggestion on PISTACHIO BRAINSTORMIN* on how to make a good and adaptive screen ration. For every different screen size, let's say I put the perfect circle as a Texture in ...
-2
votes
1answer
1k views

The best way to structure/design game code [closed]

My question is quite broad and related to the 2D game code design/architecture/structure. Usually the main game consists of the main loop where you update & render your world states. However, ...
-2
votes
1answer
631 views

Ray casting on a mesh using libgdx [closed]

I'm trying to perform ray casting on a mesh using libgdx. I found this code sample and it misses some explanations. What do these vectors stand for? What is globalIntersection and localIntersection?
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 ...
0
votes
2answers
948 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 ...
2
votes
2answers
524 views

Collision checking problem on a Tiled map

I'm working on a pacman styled dungeon crawler, using the free oryx sprites. I've created the map using Tiled, separating the floor, walls and treasure in three different layers. After importing the ...
1
vote
1answer
535 views

Saving and Loading the Game (Automatically or Manually) via Internal Storage Only (Tablet PC Issues)

Here is my question. When making a game app for Android, I considered first the device. It's no problem to save progress everything (from levels to records) on a smartphone because it has an SD Card ...
3
votes
2answers
981 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 ...
2
votes
0answers
992 views

How do I generate mipmap .png and model .obj files for LibGDX?

I'm playing a bit with LibGDX (OpenGL ES 2.0 wrapper for Android). I found some sample code which used prepared files to load models and mipmap textures for them, e.g., at ...
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
0answers
1k views

TileMapRenderer in libGDX not drawing anything

So I followed the tutorial on the libGDX wiki to draw Tiled maps but it doesn't seem to render anything. Here's how I setup my OrthographicCamera and load the map: camera = new ...
-5
votes
2answers
919 views

How draw game level in libgdx? [closed]

I am new in game programming. I am trying to draw wall like in example. EXAMPLE I am not getting how will i do this. Is any matrix logic i have to implement or i have to use full image.
2
votes
1answer
124 views

Uniform not being applied to proper mesh [closed]

Ok, I got some code, and you select blocks on a grid. The selection works. I can modify the blocks to be raised when selected and the correct one shows. I set a color which I use in the shader. ...
2
votes
1answer
4k views

Can networking be platform independent in a libgdx game?

LibGDX supports Desktop (Windows, Linux and Mac), Android and web applications. Can i code the network part of an online game without taking care of what kind a of application i'm running? i.e coding ...
1
vote
1answer
391 views

Edge flicker when moving Camera (2D)

I have a Orthographic camera. I have a fixed landscape texture and a texture for a moveable object. If the object moves to the right the camera will also move with the object. When I also draw an ...
2
votes
3answers
375 views

How can I create a spritesheet animation with big images?

If I have a 200x200 pixel sprite, and I want to create an animation for it with 30 different frames, how can I accomplish that? I can't put them on one texture/spritesheet.
6
votes
3answers
860 views

Understanding how to create/use textures for games when limited by power of two sizes

I have some questions about the creating graphics for a game. As an example. I want to create a motorbike. (1pixel = 1centimeter) So my motorbike will have 200 width and 150 height. (200x150) But the ...
1
vote
1answer
284 views

Fixed texture size (Pixel) libgdx, java

If I resize the window (e.g. fullscreen) the texture size also changes! I want that behaviour: If I change to fullscreen you will see more of the game world. The size (Pixel) of the texture stay the ...
6
votes
2answers
2k views

LibGDX - Check if currently on Android/Desktop

I'm using LibGDX and flixel-android to build a Desktop/Android game. It feels like there should be a way of checking to see if you're currently being run on an Android device, the Desktop, and so on, ...
2
votes
1answer
778 views

2D game world creation (libGdx, java)

I'am starting to develop a 2D game with motorbikes. My Question now is: When my bike reaches the right edge the world should move. (Like in that game: Game example) My first thought was to implement ...
1
vote
2answers
563 views

strange behavior in Box2D+LibGDX when applying impulse

I have been playing around with Box2D and LibGDX and have been using a sample code from DecisionTreeGames as the testing ground. Now I have a screen with four walls and a rectangle shape, lets call it ...
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()" ...
6
votes
1answer
3k views

Repeat texture in libgdx

How to fill region with repeated texture? Now I'm using next method: spriteBatch.begin(); final int tWidth = texture.getWidth(); final int tHeight = texture.getHeight(); for (int i = 0; i < ...
1
vote
2answers
1k views

How can I make a tile appear on top of another without completely blocking the tile below?

Making a small RPG with libdgx just for learning about how to draw tiled maps and move around in them. I've got the tiles drawn and OrthographicCamera stuff figured out so I can see my world. My ...
1
vote
3answers
2k views

How can I create a flexible system for tiling a 2D RPG map?

Using libgdx here. I've just finished learning some of the basics of creating a 2D environment and using an OrthographicCamera to view it. The tutorials I went through, however, hardcoded their ...
0
votes
4answers
2k views

Something like libgdx for C++ / cross-platform (with mobile) SDK [closed]

Is there an SDK like libgdx which allows me to code in C++? I really like the features libgdx has, but would prefer to code in C++. I've looked around but can't find anything. I found the commerical ...
2
votes
2answers
600 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
3answers
1k views

Pass a single boolean from an Android App to a libgdx game

I'm writing an Android application that needs to pass a single boolean into an Android game that I am also writing. The idea is that the user does something in the App which will affect how the game ...