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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
51 views

How to save score without resetting to 0 between Game Scene and Pause Scene?

I'm currently working on a LibGDX Java Game Project inspired by the Space Invaders game where I have created 2 Scene Classes: LevelScene and ...
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 ...
0 votes
2 answers
1k views

Resize font when screen resizes desktop Libgdx

I create my font using the following code: ...
1 vote
2 answers
2k views

How can I implement online high score in LibGDX?

I found some posts that said to use Google Play Services. What about other platforms? Is their some libgdx library that I can use to implement it in core section or do I need to write separate score ...
1 vote
1 answer
2k views

Libgdx clicklistener of Image Actor not recognising click

So I am attempting to make a an image of a closed door for a ship. On clicking this door, it would then change to an open door. However, I am struggling to get the click listener to work for the Image....
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 ...
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 ...
0 votes
1 answer
35 views

Understanding vector2 set in Libgdx

I am trying to understand why in the following code the programmer user vector2.set() ? ...
0 votes
1 answer
1k views

Import and run LibGDX project in IntelliJ

I followed this guide to import a demos project, but when I set the class path of the module to the desktop, then click on the button of the main class field and select the ...
5 votes
2 answers
5k views

Act on Right Mouse Button click on Button

I want to be able to listen for a right mouse click onto a TextButton. Is this possible without removing the default ...
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 ...
0 votes
0 answers
15 views

How to setup position of an image overlayed another in a stack libgdx

I have tried to change the position of the image bagitem[i]( which items are covered by a green border square; it only used method debug() to appear the border) to center in many ways but have not ...
1 vote
1 answer
780 views

Can't deserialize parameters from JSON in LibGDX

I am quite new to JSON and I have been having trouble with this data-driven asset manager (not my code). I have been trying to deserialize parameters for my TmxMapLoader object from JSON. It takes the ...
0 votes
1 answer
1k views

LibGdx Positioning the camera

I've been following some tutorials about libGdx and I've tried to create a 2d platformer but I've got stuck at how would be the right way to make the camera not go out of the screen when the player ...
1 vote
1 answer
972 views

LibGDX Button and Table Layout

I want to change the position of the Buttons inside a table, I tried setting their X and Y, or get their position when adding the Buttons on the Table, but it didn't work. It always aligns the button ...
1 vote
2 answers
999 views

LibGDX with SoundPool

I'm developing a game for Android using LibGDX in Android Studio. I recently found out that some sounds in my game fail to play. I noticed that every time a sound fails to play, these are the logs: ...
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 ...
0 votes
1 answer
919 views

Level Selection libgdx

I'm following the Canyon Bunny example in making my own game and I'm at the point where I want to implement a level selection screen. The way the example code works is that there's a ...
1 vote
1 answer
2k views

Change game from portrait to landscape dynamically

I have multiple classes that implement Screen. I want to, say, have the Main Menu screen portrait, then the Play Screen ...
1 vote
1 answer
834 views

How to minimize the repetitive creation of component in libgdx ashley?

The below example is creation of character Entity. My problem is do I always need to call these engine.createComponent(...class) ...
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 ...
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 ...
1 vote
1 answer
564 views

How to draw a list of images?

I found an example with strings ...
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 ...
1 vote
1 answer
405 views

How do I make a hitbox for a sword in a top-down game?

Context: I'm using Box2D through LibGDX in Java. The sword and the player are in separate classes. Both extend LibGDX's Sprite class. I've got a sword attached to my character that swings when I ...
0 votes
0 answers
21 views

libGdx Box2d Sword

Is there a good way to use libGdx Box2D as the main library for a rogue-like game? I want so items could be picked, dropped, and when they are picked to be a separate part of character (I tried ...
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 ...
0 votes
2 answers
5k views

SpriteBatch being drawn outside of Stage?

Currently working on my first game, though running into some problems with libgx and screen aspect ratio. What I have is a Stage which contains things like menu buttons etc, and the rest of the game ...
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: ...
1 vote
2 answers
2k views

How to use moveTo Actor?

How to use moveTo? I do so: actor.addAction(Actions.moveTo(500, 500, 10)); but he does not move Thanks you UPDATE does ...
3 votes
1 answer
897 views

Increase friction with a friction joint

I'm making a topdown 2.5D game (think the legend of zelda: a link to the past) using libgdx and box2D. to simulate friction from a topdown perspective, i've set the gravity for the box2D world to 0, ...
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. ...
2 votes
1 answer
1k views

#iterator() cannot be used nested

I'm getting this error when I try to check if any of the targets overlap each other: ...
0 votes
1 answer
406 views

InputListener not working on a custom Actor

Right now I am working on a UI for my game. I'm adding my own UI elements to a group and adding that to a stage. But the listeners I'm adding to the actors are not firing off at all. I have looked on ...
0 votes
2 answers
990 views

How can I have margins or padding around a texture in libgdx?

I am building a game using libgdx a 2048 like game and I draw the tiles of the board using textures (each texture represents a tile with the number 2 or 4 etc.) I would like tohave a small space ...
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 ...
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 ...
1 vote
1 answer
68 views

LibGDX websockets GWT html app cant find source to WebSocket class

I'm using this library to connect to websocket server: https://github.com/czyzby/gdx-lml/tree/master/websocket It's working on android/desktop applications, but when compiling to html gwt app with ...
0 votes
2 answers
988 views

Is there an existing Quadtree implementation in libGDX?

I've seen a lot of sites that recommends to use Quadtree for splitting the array by levels and nodes for a better performance for example in CollisionSystem there's ...
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), ...
1 vote
0 answers
24 views

LibGdx switching between multiple UI panels

Let's say I have a game screen with a game world stage and UI stage. UI has a build button in the corner which should open a full screen build menu window/panel while hiding game world and the ...
1 vote
2 answers
518 views

Disposing objects when changing screens

I'm making my first game with LibGDX and Box2D, and I've realized that the memory used increases when I change screens. It starts from 150MB and progressively reaches 850. How should I deal with this? ...
1 vote
2 answers
803 views

Problem with animating in Android, using batcher.draw in LibGDX

I am having a problem with the last part of the GameRenderer class. I call batcher.draw() and receive this error: The method ...
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 ...
0 votes
0 answers
29 views

LibGDX Table rendering order draw calls

I'm using LibGDX Table for drawing some simple structure but I am having problem with draw calls and texture binding handling. For clarification, I have a ...
0 votes
1 answer
387 views

Libgdx can't read .ttf file when running Android configuration

Firstly, I am aware that a similar question was asked some time ago that went unanswered. Currently, it has multiple upvotes but no answer. The error ...
1 vote
2 answers
550 views

What is moving the camera useful for, if I have to do culling myself?

I'm new to libgdx and especially to using OrthographicCameras. I'm trying to understand how useful they are. The question is, suppose I have a game map 500 units wide. I have an OrtographicCamera ...
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? ...
0 votes
0 answers
20 views

In LibGdx, how to add another music format?

I would like to add multiple music formats to the LibGdx library, like .vgm, .mod, .s3m, .xm and so on. I already have the Java code to do so, but it's hard to integrate it with LibGdx code. I know ...
0 votes
0 answers
29 views

I use skin composer, I want to create scene in scene composer, I can't add text buttons even though I created text buttons

I create text buttons, add every image and font, but it's still disabled when I want to add button in scene composer. I'm probably doing something wrong.

1
2 3 4 5
46