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
2answers
996 views

Perspective camera for 2D

I'm very new to LibGDX and I'm trying to use DecalBatch with PerspectiveCamera, simply to have Z-coordinate for my sprites, as SpriteBatch does not offer that. However, I don't know how to calculate ...
7
votes
1answer
2k views

How to force a line break before the last word of a line reach the edge?

I'm printing a sliding text by adding each letter after a short period of time. My problem is that when the text multilines, the last word of a line starts on the current line and jumps to the next ...
1
vote
2answers
3k views

LibGDX Swipe Detection Left and Right

I have displayed an image at the center of the screen with libgdx. If I swipe left, the image should move to the left; and, if I swipe right, image should move to the right. Subsequent swipes to the ...
0
votes
1answer
657 views

Using compressed(ETC1) textures in LibGDX

I use standard android tool for compressing PNG texture and archiving it with gzip: /android-sdks/tools/etc1tool texture.png --encodeNoHeader gzip texture.pkm Then I try to load it: FileHandle ...
7
votes
4answers
1k views

Making a Box2D ball bounce to constant height

I want to create a game like Doodle Jump. I'm using libgdx and Box2d. I needadvice on how to make my ball bounce constantly and with the same height. I've tried setting the ball's body restitution ...
3
votes
1answer
3k 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 ...
0
votes
1answer
100 views

Eclipse/LibGDXgame doesn't load textures [closed]

Our LibGDX project doesn't load textures after building on PC/Android but when it's built from Eclipse using Ctrl + F11 (Run/Debug) everything is fine. What could be causing that?
3
votes
1answer
2k views

ShapeRenderer efficiency on games

I want to draw a rectangle box to use as a text background for a visual novel library I'm writing, I wanted some flexibility of color and transparency and the ShapeRenderer class seems to fit the need ...
2
votes
1answer
321 views

Not repeating background in platformer [closed]

I need to make not repeating background for platformer. I can't find any description of implementation and I developed algorithm but I'm not sure that it's right. I can't load one big texture per ...
2
votes
2answers
446 views

What to use as a Box2D renderer in a release version?

I'm creating a game with libgdx. For testing physics I use a Box2DDebugRenderer, which is not fast. When I want to release my full game, what should I use as a renderer?
1
vote
2answers
1k views

Render rotated rectangle inside other rectangle bounds using Libgdx

I have this code to generate a red rectangle inside a grey rectangle: new Rectangle(grey_rectangle_position_x, Game.SCREEN_HEIGHT/2-Rectangle.height/2,0); This code makes the following: Now, I ...
0
votes
1answer
873 views

Ligdx Box2d : convert box2d coordinates into screen coordinates

I'm new in libgdx and i have a little problem. I created a body in box2d and i want to assign it a sprite; for that i need to get the position of the body,then insert into the main loop the updated ...
0
votes
1answer
229 views

Devices or Smartphones That Can Run and Displayed Images Properly While Power of 2 Code is Disabled

Before making game apps, I want to have any certain smartphone device brands that runs on OpenGL. I have to make a code for images that doesn't need to required power of 2 images so that I can resize ...
1
vote
0answers
450 views

Libgdx Particle Editor: Blank UI elements

How can I get Libgdx Particle Editor to run properly on my 32-bit Windows 7 machine? When I run it, the UI elements are blank like this:
0
votes
1answer
611 views

Coordinates different between Tiled editor and my game

So I have been using Tiled map editor to create my map for my game. I'm using Libgdx to load and draw the map. The problem is that the coordinate from objects placed in tiled do not seem to be the ...
1
vote
1answer
277 views

Terrain detection on racing game

Hi I don't speak English very well so ill try to do my best :P I'm doing my first top-down racing game for LibGDX, now I need to create tracks, the tracks aren't very large, I prefer doing this with ...
3
votes
1answer
340 views

Fill texture with white color

How to paint texture with white color? Example what I mean: SpriteBatch.setColor changes tint only.
1
vote
0answers
65 views

Another Question from the Image Efficiency for Memory Handling [closed]

At this topic, "Which image format is more memory-efficient: PNG, JPEG, or GIF?", one of the fellow Game Development community @Panda Pajama told about the complex concept about image memory handling ...
0
votes
1answer
1k views

Can I develop libgdx game with C#?

I see some articles through Google that I can use libgdx in C#. Is it true? I found no official and unonfficial about this. If there is a way, please tell me how. Thank you
-2
votes
1answer
189 views

Music and SFX Question on Memory Efficiency [closed]

What should I recommend: MP3 or WAV for the SFX? Also, what should I do to handle the memory in music or SFX?
50
votes
5answers
12k views

Which image format is more memory-efficient: PNG, JPEG, or GIF?

Which image format is more efficient to save memory? PNG, JPEG, or GIF?
1
vote
1answer
2k views

Repeat texture in a scrolling game

The bottom region of the screen is filled by a repeated texture: grassTexture = new Texture(Gdx.files.internal("images/grass.png")); grassTexture.setWrap(TextureWrap.Repeat, TextureWrap.Repeat); ...
10
votes
2answers
838 views

How well do functional languages perform on Android?

This is a special case of this question that I feel is particularly pertinent. I'm working on a game for Android, and I'm planning on using Scala with libgdx. I'm planning on making a performant ...
0
votes
0answers
607 views

Limited Screen Switching Count Memory Issue

When making my simple app for revisions to update the latest changes, I test it first between the device (Google Nexus 7) and desktop using Eclipse IDE. I made eleven screens for the game in terms of ...
3
votes
1answer
2k views

Getting Bodies to go “Super Fast” in Box2D

I am making a breakout game in Android using the LibGDX version of Box2D. I have a ball that I am applying a force to with the following code... getBody().applyForceToCenter(-10000000000.0f, ...
2
votes
2answers
1k 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 ...
1
vote
0answers
2k views

Creating live wallpaper on Android with libgdx [closed]

I try to create live wallpaper with libgdx framework. Here's my source code: repository When I run this, black screen with name of the app appears (probably empty android layout). Main game is not ...
15
votes
2answers
958 views

Graphics not being displayed on OUYA

I hope its not too early to be asking OUYA dev questions, but I just got my dev kit and I want to get my game running ASAP! I am using LibGDX as my framework for my game and launching the Android ...
1
vote
1answer
380 views

Keeping Track of Position OpenGL

I have a sphere in my 3D world located at the origin. I have models orbiting it and I need to keep track of each models' position (x, y, x coordinates) as well as update their bounding boxes for ...
3
votes
1answer
2k views

How to fire a touch event only for the touched sprite?

I have a set of sprites, each one implementing InputProcessor, and registered to an InputMultiplexer, when a sprite is touched, everyone fires the touchDown event. Ok, so I can get the touch ...
0
votes
1answer
800 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
2k 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
211 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
416 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
1k 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
400 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 ...
2
votes
0answers
612 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
874 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
582 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
963 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
1k 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
2k 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
719 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
2k 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
179 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
241 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
491 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
285 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
587 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 ...
13
votes
3answers
1k views

What libgdx project files can I ignore from version control?

In an automatically created libgdx project, what files can I safely tell Git (or other revision control systems) to ignore? I'm considering these: *-android/.settings/ *-android/bin/ ...