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
117 views

Merging InputProcessor and GestureDetector

I'm planning to make a simple soccerball app. When I attempt to drag the ball, I use the touchDragged() from InputProcessor to move the ball left or right. Next, while holding before releasing, I use ...
1
vote
1answer
2k views

How to implement bullet physics in libgdx

I am new at game development want to know that how can I implement bullet physics in libgdx. I searched lot of things on Internet but nothing found worthy.
3
votes
3answers
384 views

Libgdx body passing through block then fall on it

I'm using libgdx and its physic engine Box2d. My question is : how could I make my box2d body go through a block , ignore the first collison than make the block active so the ball can fall onto it. A ...
3
votes
1answer
200 views

Cut a translucent square in a texture

How to remove (cut-out) a transparent rectangle in a Texture, so that the hole will be translucent. On Android I would use the Xfermodes approach: ...
1
vote
1answer
246 views

Pick and Drop the Ball Testing Without Replicating the Physics Frame

I am making a program that pick, drag, and drop the ball. In real life, once you pick the ball and drop it, whenever the available object is (what you see is what you get) will only be picked and ...
4
votes
1answer
595 views

Mario like jumping and landing in box2d, help

I've been trying to get Mario type jumping/landing in a Box2d game and it's been giving me some trouble. Results: Player loses velocity on landing Desired Results: When player lands it will continue ...
0
votes
2answers
835 views

LibGDX 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
1k 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
2k 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
540 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
92 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
1k 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
305 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 ...
1
vote
2answers
363 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
768 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
211 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 ...
0
votes
1answer
372 views

Black Screen on pressing back button in libgdx

In my game when i touch on advertisements and press back button to return on game the i am getting a black screen. I referred this link. I tried to change IosGraphics.java but the change is not ...
1
vote
0answers
435 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
493 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
253 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
311 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
64 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
981 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
178 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?
49
votes
5answers
10k 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
755 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
548 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
970 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
946 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
349 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
661 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
204 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
390 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
379 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
569 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
778 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
505 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
809 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
986 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
660 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 ...