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

-1
votes
1answer
35 views

LibGDX Json not parsing full file

I'm trying to load a World with different Objects (World Objects and Entities). For that, I want to use Json. For less than two elements this works like a charm. But as I add more elements, some ...
-1
votes
0answers
28 views

rotate the image as finger move

I am facing a problem when rotating an image as my fingers move. I am getting a small deviation. Can anyone help me to resolve the problem in this code? public void touchDragged (InputEvent event, ...
0
votes
0answers
29 views

LibGDX - How to move Actor with fingers Code?

I am completely new to Game Development. I See all these Questions and Answers and Codes and I have no clue what to do with them. I need some Guidance. My Plan: I want my Actor to move up and down, ...
0
votes
4answers
84 views

Accurate sprite rotation with mouse movement

I am using the current mouse position to aim the player sprite, but I am not getting the best results. It will often by off by a noticeable amount, or even a complete ~180 off if I go from one side, ...
1
vote
1answer
71 views

Does scaling affect performance in OpenGL? [closed]

I've never been able to understand the best practice in this context. I usually want to ship my game with as minimum size as possible. So whereever possible, I try to use scaling of my graphics. Let's ...
-3
votes
0answers
29 views

Selecting interstitial advertisement companies for android

I'm developing an android game using the libgdx framework, and have reach a notorious doubt, what's a good way to place advertisement into my app. My first choice are interstitial advertisements, ...
0
votes
1answer
54 views

Rendering tilemaps at a specific position libgdx

I'm making an endless side scroller game like gravity guy with libgdx. To test this I'm just creating two tiled maps with the same .tmx file to render then one after another, like: ...
1
vote
2answers
40 views

Unable to draw single particle effect at two places

I am using Libgdx ParticleEffect to draw a fire particle effect . The issue I have is that when I try to render a ParticleEffect at two different locations within single game loop, only the last ...
0
votes
2answers
119 views

How do I switch between the game screen and score screen without redrawing everything?

I'm working on a multiplayer game in Libgdx and want to display the scores of say, the top 10 players on the map. The player should be able to checking the scores at any point during the game and ...
0
votes
1answer
42 views

How can I create a button with an image in libGDX?

I am new to LibGDX. I am trying to develop a game for Android (so it will support different screen sizes), but I don't know how to put a button with an image. I tried ImageButton but I can't resize ...
0
votes
1answer
22 views

LibGDX - Accelerometer Problems

I got some issues. I'm using LibGDX. When I hit an object, my Fighter is supposed to fall to the Ground. BUT, because of the Accelerometer, i can still move it up and down eventhough it died. The ...
0
votes
2answers
2k views

Detecting key press only once in Libgdx [duplicate]

Have a question on keyboard inputs. Currently I am using this method to read my input, Gdx.input.isKeyPressed(Input.Keys.A), it is working fine. But I do realized at times there are multiple instances ...
0
votes
0answers
20 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 ...
0
votes
0answers
24 views

setRotation in touchDrag

I have a problem, have Actors that represent game pieces. What I'm trying to do is make it so the player can click-and-drag the tile to move it around one fixed position in the screen and rotate. I ...
0
votes
2answers
726 views

Problem with AssetManager while loading a Model type

Today I've tried the AssetManager for the first time with .g3db files and I'm having some problems. Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: ...
0
votes
1answer
36 views

Swiching screen at collision LIBGDX

I am programming with LIBGDX and I am working with a piece of code. What I want to happen is that when the BUCKET collides with a DROP the game switches screens back to the menuScreen. I have tried ...
1
vote
1answer
97 views

Multiple enemy array in LibGDX

I am trying to make a multiple enemy array, where every 30 secods a new bullet comes from a random point. And if the bullet is clicked it should disapear and a pop like an explosion should appear. And ...
-1
votes
2answers
360 views

Publish android game only for 800 x 480 resolution in portrait mode

I have developed a game in libgdx. I worked for long and after finishing, I found that the game runs perfectly only on devices with resolution 800 × 480. I found this solution: ...
2
votes
1answer
130 views

Is there a difference in these two ways of rendering sprites?

I use an OrthogonalTiledMapRenderer: renderer = new OrthogonalTiledMapRenderer(world.getMap()); and I wonder if there is a differnce between this call: renderer.getSpriteBatch().draw(sprite, ...
1
vote
2answers
78 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 ...
0
votes
1answer
84 views

Which input event is suitable for this game?

I am trying to clone this game: http://www.ferryhalim.com/orisinal/g3/bells.htm As i am using libgdx, so the game is both for Android and PC. I was wondering which input event would fit in nicely. ...
0
votes
1answer
13 views

Loading TextureRegion with filter diff from that of texture it came from

I am using libgdx . While packing my texture atlas I have set the filter for mag and min to Nearest . But for just one region I wish to draw it with linear filter . Is it possible to have different ...
0
votes
1answer
25 views

how to check in single event that two object clicked at same time in libgdx

I am newbie to libgdx, i wrote 2 functions for touchdown, LockerKeyHalfImage.addListener(new InputListener() { public boolean touchDown (InputEvent event, float x, float y, int pointer, ...
0
votes
1answer
90 views

Making Player Jump

I have been editing a piece of code and I have already implemented gravity so I would like to know how i could make the player jump when the screen is touched. I would like the player bucket to jump. ...
0
votes
0answers
13 views

Transitive dependencies show up in desktop but not android project

I created a generic library (PB) which I'm referencing in my core project (mega-whack). Here's what the dependencies look like (simplified build.gradle): project(":pb") { dependencies { compile ...
1
vote
0answers
147 views

How should matrix-based Parallax Scrolling work?

The question is at the end, as it requires a bit of context. I'm not sure if my understanding, my code, or LibGDX's ParallaxCamera is wrong. LibGDX's ParallaxCamera uses Matrix4s to achieve a ...
1
vote
0answers
396 views

Resize the Texture Region (parallax background) to fit my screen size in libgdx

I am using libgdx to make a running game. I am using vertical parallax background. I have successfully implemented parallax background many times. But for this game, I want my Texture region to fit my ...
0
votes
0answers
45 views

Make LibGDX game responsive to different phone screen sizes?

I've been experimenting with small games to learn design concepts, LibGDX, and Box2D. I am wondering how you would implement "responsiveness," so to say. For example, this is the rendering part of my ...
-1
votes
4answers
88 views

Shooting based off mouse position [duplicate]

I'm trying to shoot bullets where the mouse is aiming using one image as a test. I'm trying to get the mechanics like this I have some kind of algorithm to handle that but the results arn't too ...
0
votes
2answers
890 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 ...
0
votes
1answer
591 views

libgdx actors and instant actions

I'm having trouble with actors and actions. I have a list of actors, they all have either no action, or 1 sequence action This sequence action has either : a couple of actions (some are instant, ...
0
votes
3answers
135 views

What is the easiest way to make an object follow the edge of a sprite?

I have a rounded rectangle sprite and another sprite that's just a circle. I want the center of the circle to follow the edge of the rounded rectangle. Is there any easy way to accomplish this task? ...
1
vote
1answer
123 views

Libgdx stage rendering issues

I'm using scene2d for the first time, and I can't get anything to draw EXCEPT the stage ui. Say I have my ui on top of my game screen: uiStage.act(): batch.begin(); gameSprite.draw(batch); //does not ...
0
votes
1answer
40 views

Ball bouncing with box2d in libgdx

I just started using Box2d and libgdx. I followed this tutorial, https://github.com/libgdx/libgdx/wiki/Box2d And a ball would bounce if I run the following code I took from the tutorial. // ...omit ...
0
votes
1answer
1k views

How to update libgdx scene2d Label text dynamically?

I display a BitmapFont on the screen, update its text and the font is updated dynamically on the screen as well. I seem to fail to do the same with a scene2d Label added as actor to a Stage. The ...
0
votes
2answers
108 views

2d Ice movement

I am building an top-down 2d RPG like zelda. I have been trying to implement ice sliding. I have a tile with the slide property. I thought it would be easy to get working. I figured that I would ...
2
votes
3answers
843 views

libgdx - collision detection with tiled map java

currently, I am working on a 2d rpg game which is similar to final fantasy 1-4. I can load up a tiled map and the sprite can walk freely on the map. However, I will like to create a wall for it to ...
0
votes
4answers
6k views

How to rotate a sprite on circle in android using Libgdx

Dear Fellow Game Developers i am newbie to Android Game Development,i like to know how we can develop a sprite rotate in circle on android,with help of libgdx, i do have a image in assets ...
2
votes
1answer
185 views

How do I split a texture into differently shaped pieces with libgdx?

I want to split a texture into variously shaped pieces with libgdx, like the pieces of a puzzle game. TextureRegion.split() is not an option, as it splits into equally sized rectangular texture ...
2
votes
1answer
72 views

Daily Unlock in LibGDX

I am trying to make a game that is a collection of mini games. The mini games will unlock daily. There are story for each day. And the story cannot be repeated so for example the player start playing ...
0
votes
1answer
31 views

LibGDX ShapeRenderer rotated

I'm having a weird problem with the LibGDX ShapeRenderer where it draws everything rotated. Here are some images to show you what i mean: This is what it looks like in Tiled(Map Editor): This is ...
0
votes
1answer
35 views

Setting bounds to a label in libgdx

textStyle = new LabelStyle(); textStyle.font = font; textStyle.fontColor=Color.GREEN; EnterTextCasheir= new Label("",textStyle); EnterTextCasheir.setBounds(AssetsHelper.convertWidth(158), ...
1
vote
2answers
50 views

Using libraries in libgdx

This is the first time I'm using libgdx and I've got one problem. I am confused by the web of dependencies and the number of projects and I'm not sure how and mostly where to add a third party library ...
0
votes
1answer
201 views

libgdx ActorGestureListener.pan() parameters not moving actor in smooth line

I override the pan method in ActorGestureListener to implement dragging actors in libgdx (scene2d). When I move individual pieces on a board they move smoothly, but when moving the whole board, the ...
0
votes
1answer
86 views

How to keep track of previous scenes and return to them in libgdx

I have three scenes: SceneTitle, SceneMenu, SceneLoad. (The difference between the title scene and the menu scene is that the title scene is what you see when you first turn on the game, and the menu ...
2
votes
1answer
102 views

Yet another libGDX resolution independance question

I am developping a Android smartphone game in LibGDX, and I am encountering issues about resolution managing. Most notably, I have no clue how to handle that in LibGDX. For now, I am developping ...
0
votes
0answers
28 views

LibGDX ImageButton resizeing

How can I resize ImageButton ? It show very big on screen . How I know it is an Actor and it is not resizing automatically . I can`t find the method for resizing it. Any ideas?
0
votes
2answers
109 views

libgdx - handling battery warning

I want to pause my game when the battery warning on Android pops up. How do I do this? I have a method that pauses the game but how do I call it when the battery warning pops up?
0
votes
2answers
450 views

How to get width and height from a body in box2d?

I am working on a game in Libgdx framework. I have to get width and height from a body in box2d. is their any way to get width an d height from a body in box2d??
1
vote
1answer
50 views

Timer.schedule(task, 0, 100) never fires

I added some code using java.util.Timer to execute my spawnMonster function every 100ms. It worked, until I tried instantiating images in it -- since it doesn't run on the libGDX core thread, there's ...