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
2k views

Libgdx Animation Timing

I'm having a small issue with libgdx animation. I'm using getKeyFrame() to get the current frame of the animation and I'm updating the state time by adding on deltaTime in my update function for the ...
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 ...
0
votes
1answer
544 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 ...
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); ...
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
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 ...
2
votes
1answer
306 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 ...
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?
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?
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 ...
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
774 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 ...
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:
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 ...
0
votes
1answer
495 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
254 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 ...
1
vote
1answer
678 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 ...
10
votes
2answers
757 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 ...
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.
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 ...
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
982 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
179 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?
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, ...
0
votes
1answer
669 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 ...
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 ...
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
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 ...
1
vote
1answer
352 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 ...
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 ...
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 ...
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
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 ...
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. ...
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 ...
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 ...
4
votes
1answer
2k views

How can I track a falling ball with a camera?

I have been trying to get my camera to follow a falling ball but with no success. here is the code float cameraY = (FrustumHeight / 2)+((ball.getPosition().y) /2) - (FrustumHeight /2); ...
0
votes
1answer
166 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, ...
2
votes
3answers
1k 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
352 views

Make a callback to android methods from libgdx

How can I make a callback from libgdx to an Android method? I want to use the method to overwrite a file in the internal memory.
1
vote
1answer
461 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)); ...
0
votes
1answer
226 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 ...
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 ...
5
votes
3answers
10k views

LibGDX tutorial help Scene2D

I'm having trouble understanding this tutorial. It defines the importance of classes, but it doesn't show an outline of the project file so far. From what I got from that tutorial was that there is ...
2
votes
1answer
684 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 ...
1
vote
1answer
556 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 ...
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 ...
-2
votes
1answer
2k 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
770 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?