Skip to main content

Questions tagged [libgdx]

LibGDX is a cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux, Mac OS X, Android, iOS and your WebGL enabled browser.

393 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9 votes
1 answer
1k views

How do I draw a name above monsters head?

My player HUD works perfect, but when I move, the monster name moves with me instead of getting attached to the monster. Player has a HUD and I'm using Scene2D.ui ...
Printer's user avatar
  • 317
8 votes
1 answer
2k views

LibGDX Box2D Lights - Illuminate background

I have a box2D world made of tiles. I use a custom DirectionalLight for light up the scene from above (It shines through transparent blocks [eg.: the water] more deeply). The problem is (as expected), ...
Rothens's user avatar
  • 453
7 votes
0 answers
792 views

How to correctly implement 'layered lighting' with Box2D-Lights

How does one only allow Box2D-Lights to affect one and only one OrthographicCamera. After researching, I found the following answer. This answer goes into detail ...
BleedObsidian's user avatar
7 votes
1 answer
565 views

On Android, How can I avoid FPS drops during sensor listener setup/tear down?

When I open my Android app after 5 or 10 seconds it sets up the sensor listener, during which I see clear stuttering and the FPS drops for a second to 40 instead of 60. Is there a way to avoid this? ...
Timothy Kodes's user avatar
6 votes
0 answers
315 views

LibGDX Rectangle not Scaling to ImageButton Instance as Expected

below is the class I wrote for a GameButtoninstance: ...
HoopsMcCann's user avatar
6 votes
1 answer
450 views

LibGdx animation sequence

In my game the character movement animations work fine but now I'm trying to do a sequence of programmatic animations, for an enemy character, and it's proving to be a pain. I'm just doing it on ...
user1572522's user avatar
6 votes
0 answers
157 views

balloon ligher than air with libgdx, impementation of FixtureDef.density, gravityScale, linearDamping?

I use libGdx/box2d's physic. My intention is to create a balloon filled with helium (a body, what hovers above a surface, if we apply a little force to it - it moves fast but not far, if we push ...
Victor G's user avatar
5 votes
3 answers
876 views

How do I handle Game Screens in LibGDX?

In my game the main screen is the playscreen. But because I want to draw the menu and the gameover screen on top of the playscreen, I don't create separate screens for them. But if I want to replay, I ...
Sharpirate's user avatar
5 votes
0 answers
252 views

Implementing rubber rope

I'm using LibGDX to implement rubber rope in which player can fly and launch. I know I could use Box2D as physics engine and I'm going to one day, but I'd like to learn it myself for now. I've ...
Maciej Dziuban's user avatar
5 votes
1 answer
2k 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 ...
Brandon's user avatar
  • 51
5 votes
1 answer
2k views

Making a pixel-perfect viewport in LibGDX

My game that uses LibGDX as the graphics library, should be playable with every display. Here's the problem: It have to be pixel-perfect. That means, the scale factor must be an integer value, so that ...
null's user avatar
  • 191
4 votes
0 answers
488 views

Moving all the particles in effect LIBGDX

I have a few particle effects that I would like to be in a circle shape in libgdx i.e. not a cone shape. I have done this by setting the direction of the particle effect from 0 to 360. The problem is ...
V F's user avatar
  • 41
4 votes
0 answers
526 views

LibGDX Shader works fine on desktop but does not work at all on Android device

I made a very basic shader that works perfectly fine on Desktop, but when I try it with an AVD the sprite affected by the shader is not drawn. I have tried with WQVGA API 16 and Nexus S API 23. I have ...
Cedric Martens's user avatar
4 votes
2 answers
290 views

Fine tuning light shader mechanics

I'm currently trying to implement the lighting technique described in this article. I've done pretty much exactly what is done in the article. My technique is the same, and my shader is the same. ...
grimrader22's user avatar
4 votes
0 answers
76 views

Resetting Achievement Progress for testing

I tried to reset the Achievement Progress, but it is NOT resetting the increment count and I want to delete and create a new achievement each time for testing. Is there any workaround to solve this?
VARUN ISAC's user avatar
4 votes
0 answers
892 views

Porting libgdx game to iOS using Multi-OS engine - how to add Admob ads

I want to port my libgdx game to iOS using Multi-OS (RoboVM is no longer available). I've searched whole internet but can't find any info about how to use Admob with Multi-OS engine on iOS. Every ...
bpawel10's user avatar
4 votes
0 answers
800 views

Libgdx stops all sounds when there are lots of sounds

I'm making a 2D game for Android using Android Studio with Libgdx in Java. I have a class, called SoundPlayer, which holds an ArrayMap. The key is the name of the sound file and the value is the sound ...
Gad Wissberg's user avatar
4 votes
0 answers
1k views

Libgdx performance on old devices

I'm developing a game in Java for Android, using LibGDX. I'm using Nexus 5 to test my game most of the time and it works great (Minimum FPS it gets is 57 out of 60). Recently I ran my game in Galaxy ...
Gad Wissberg's user avatar
4 votes
0 answers
1k views

LibGDX's HTML project doesn't show anything in Browser

The question is self explanatory, when I run my demo-html project as a Web Application and I open Chrome with the provided link by eclipse, my browser doesn't show the image it is supposed to show in ...
yat0's user avatar
  • 153
4 votes
1 answer
521 views

Scene2d Stage Actor setup issues

I am creating a game using libgdx. In the same each level has a class. I have stage as a member variable of the class. To this stage, I add actors. Inside the levels class, I have attaced the input ...
rrd's user avatar
  • 41
4 votes
0 answers
2k views

Drag And Drop in libGDX (Target and Source)

I'm trying to put together a drag and drop system in libGDX with the help of DragAndDrop class. I have the typical system in which you can drag something into a box. So far it is working all dough I ...
yafrack's user avatar
  • 163
4 votes
1 answer
1k views

HTML/JS publish LibGDX

I want to publish an app created with libGDX (HTML/JS publishing). Here are the steps I am doing. Right Click on the Project -> Google -> Gwt Compile -> Compile. After the compilation there is no ....
Vahe Muradyan's user avatar
3 votes
0 answers
2k views

How to sync entities in an ECS game?

I'm wondering how to engineer a client server sync of entities in a multiplayer game which is using an ECS. When the server changes some values of the components of an entity, I thought the best ...
EchtFettigerKeks's user avatar
3 votes
1 answer
220 views

Mipmaps for Automatically Generated Texture Objects

I want to generate mipmaps for textures generated by BitmapFont(FileHandle fontFile) constructor. Since it doesn't have that option, what can i do? Can I somehow deep copy the Texture object with ...
hellgasm's user avatar
3 votes
0 answers
423 views

Weird libGDX BitmapFont Color Change (And Alpha) Bug

I want to change the color of my libGDX BitmapFont, but it can't change it. The font is generated with Hiero v5 (Lastest as I Know) but the color of the font doesn't change. Here is the example code, ...
user2963359's user avatar
3 votes
0 answers
248 views

Android LibGDX 1.9.6 Augmented Reality captured images are black

Using LibGDX for an AR application and capturing image and merging lines and texts on LibGDX with image with this code. ...
Thracian's user avatar
  • 114
3 votes
2 answers
5k views

Rendering Smooth Text in Libgdx

I am trying to draw text onto the screen but it always ends up being pixelated no matter what I try. A lot of people say that adding the Linear TextureFilter works or offer other solutions but they ...
chip_s11's user avatar
3 votes
0 answers
556 views

Combine a light and water shader in libgdx glsl

I am trying to combine a light shader with a water shader in libgdx. Shader programming is not one of my strengths at all. This is the water effect rendering nicely: And when I have added the ...
zimspy's user avatar
  • 347
3 votes
3 answers
790 views

How to keep track of camera's rotation while it's being rotated?

I'm building a 2D game where the sole interaction of the player is rotating what they can see (this is currently the camera, though it could be the world) by plus or minus 60 degrees. My current ...
Didia's user avatar
  • 176
3 votes
1 answer
761 views

Moving sprite using the accelerometer in LibGDX?

I don't know how to use accelerometer in LibGDX; how could I use the the motion sensor? I'm working for a top down game with the motion sensor. I'm new to this framework. My sprite image is already ...
zarawayun's user avatar
3 votes
0 answers
1k views

Pixel Art size for different resolutions

What size I should make the UI elements (mostly buttons). How do pixel graphics look good on all resolutions? How would I get to know what size I need the buttons or other pixel graphics overall?
Kaarel Reinvars's user avatar
3 votes
0 answers
465 views

Get mesh height at position

Me and my friends are creating a simple 3D game in LibGDX and are currently trying to implement simple collision detection with the terrain (ground). For this I thought the best way would be to simply ...
Charanor's user avatar
  • 7,870
3 votes
2 answers
4k views

Use Stage's draw() method to invoke Actor's draw method in Libgdx

Question : In the following snippet, I wish to draw different shapes such as rectangles, circles, triangles etc. I will be creating different class files for each of such objects, as I did for ...
user2582651's user avatar
3 votes
0 answers
629 views

libGDX text doesn't appear in TextField

A game I'm working on has libgdx's TextField. They work fine in every instance I've used them, however on a play tester's phone he says no typed text appears in the box until enter or space is ...
M1LKYW4Y's user avatar
  • 131
3 votes
1 answer
2k views

How do I implement wander behavior in GDX AI?

So I follow the original gdx-ai documentation and created 2 circles to test Steering behavior. The image shows arrival behaviour but I am still quite lost about how they work. Screen class: ...
tipsywacky's user avatar
3 votes
0 answers
65 views

Behvior of Ninepatch when smaller then unstrechable area?

I create a healthbar from a Ninepatch background and "fill" texture. However, it starts overlapping it's patches when it gets very small. Is there anything I can ...
Madmenyo's user avatar
  • 1,979
3 votes
0 answers
268 views

Texture gets blurry when moving Box2D body

I'm having this issue that is very annoying. Somehow the texture of the player body is getting blurry and leaving a slight trail with its colors when moving it. The interesting fact is, this only ...
Igor Lopes's user avatar
3 votes
0 answers
462 views

LibGDX Texture blending

I have two textures 1 and 2, and a "mask" image 3. I'd like to interpolate between the two textures by using the mask image, and get something like 4. I'm not really sure where to start, as I never ...
Rothens's user avatar
  • 453
3 votes
0 answers
238 views

Libgdx - multiple images in a group, best practices - also overdraw question

I am trying to right a card game, that will have an image in the middle, a coloured border and potentially a symbol in the top left. I am using libgdx and a stage/scene2d. The image will change ...
Russ Wheeler's user avatar
3 votes
0 answers
461 views

Smoothly fitting texture tiles using alpha gradient on edges

I'm trying to draw a background texture with tiles that I'll rotate and mirror to create a maze. Here is a sample tile: As you can see, I use an alpha gradient on the borders. If I'd use a sharp ...
Juan's user avatar
  • 193
3 votes
1 answer
513 views

Cannot draw around the screen after zooming out with LibGDX projection coordinate

I've just started developing game in android using LibGDX. I've follow some samples and now my simple game can draw path when user move their finger around the screen. now problems appear when i add ...
user724861's user avatar
2 votes
0 answers
268 views

How can I make a transparent hole with shaperenderer using stencil masking in libgdx?

I'm making a 2d game, where I need a resizeable, moveable rectangle outline. I'm trying to use stencil masking to do it by cutting a hole in a solid rectangle, and I thought this would help: How can ...
Shaw's user avatar
  • 21
2 votes
0 answers
282 views

How to add AdMob to Libgdx in 2018?

I found this article here: https://github.com/libgdx/libgdx/wiki/Admob-in-libgdx But it's from September 2017, and since then Android and Android Studio have been updated. How can I add AdMob to my ...
Erick Adam's user avatar
2 votes
1 answer
740 views

Help with Google Sign In services with Libgdx

Im looking for some help on implementing Google Play sign in. Ive got the interface part figured out, but the last time I did this, google had a gamehelper utility and now it doesnt and having trouble ...
DRing's user avatar
  • 131
2 votes
0 answers
382 views

LibGDX - TiledMap Unit Scale

I'm working on a 2D rpg-style game and I'm currently rewriting my game to get a more clean and structured code. Some thing that has been bugging me is that I have no idea how unit scales work with the ...
Dennis Björk's user avatar
2 votes
0 answers
381 views

How to add slowmotion effect in libgdx>

I want to add slow motion effect with a collision as a trigger. So I want to have an effective way to trigger a slowmotion effect on bodies as well as sprites that can be caled in the update method. ...
noobprogrammer's user avatar
2 votes
1 answer
547 views

Creating trading card board layout in libgdx

I wanna make a trading card game using libgdx. I have a general idea about how to implement the server side of the game and the game rules, but I don't know how to design the visual interface of the ...
Stems's user avatar
  • 21
2 votes
0 answers
2k views

How to achieve the top-down (oblique) projection of textures using an OrthographicCamera?

This question is related to (How to calculate the initial velocity of projectile motion by a given distance and angle from point A to B) question. Details In the below image is the graphical ...
ronscript's user avatar
  • 501
2 votes
0 answers
810 views

How to force libGDX to set display mode?

The following code represents my attempt to switch display modes. I've had to include the redundant setWindowedMode because without it, libGDX would not force the ...
norbornyl's user avatar
2 votes
1 answer
1k views

How to rotate an image on touch using RotateToAction in libGDX?

I want to rotate my image on touch but it never applies action, I'm using RotateToAction to achieve this. ...
Metin Ilhan's user avatar

1
2 3 4 5
8