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
0answers
162 views

Libgdx wallpaper offset change

i have an image that i set as background. I use texture Region for my image. i put this in update method. batcher.begin(); batcher.draw(background, 0, 0, 320, 480); batcher.end(); How could ...
1
vote
0answers
289 views

Create a touchpad-joystick using texturepacker2

I am adding a touchpad control to my game, using TexturePacker for loading images into the image-atlas. I have followed this tutorial to add the joystick. Everything is the same apart from the loading ...
0
votes
2answers
199 views

How to implement a game launch counter in LibGDX

I'm writing a game using LibGDX in which I want to save the number of launches of a game in a text file. So, In the create() of my starter class, I have the following code ..but it's not working ...
1
vote
1answer
331 views

Making Ball Fling in a Curve Direction

I was wondering how to figuring out how to slice a ball (banana kick) by flinging it curve-ways. However, according to the LibGDX's gesture listener, the method for flinging only focuses on a straight ...
1
vote
2answers
1k views

Should I accumulate state time based on a global or a parameter?

Generally, we associate a "state time" with our sprites. Libgdx provides a method to do so: float deltaTime = Gdx.graphics.getDeltaTime(); However, in the main game loop, we have a delta time as a ...
1
vote
2answers
934 views

LibGDX with Android UI

Hello I want to combine between android UI and libGDX. I want to have half of my screen with libgdx engine (animated sprite) and the other half of the screen with android UI buttons. Does anybody know ...
1
vote
1answer
83 views

Images not found in textureregion

Previously I was using simple Texture for sprite based animations, but that did not provide support for images which were not in the power of 2. TexturePacker provides with the ability to load all the ...
1
vote
0answers
233 views

Texture Region drawing issue with LibGDX

I am currently moving my old slick2d project to libgdx. I have created a custom AnimationExt class that extends Animation to which I added a draw method. The Animation's frames are actually ...
0
votes
1answer
457 views

Input events not working simultaneously on android devices in libgdx

I am making a simple platform game in Libgdx... in which I have made the player to move left, move right and jump. The code works fine on Desktop but on Android devices, Jump is not fired when the ...
0
votes
1answer
83 views

Problems implementing a Sign Sprite in Libgdx

I am making a tile based game in LibGdx. I am using the TiledMap in .tmx format. I want when my player reaches a tile whose property is set (tileType -> sign), he should see a Sign sprite and on ...
0
votes
1answer
1k views

how to use texture atlas

I am trying to implement texture atlas. 1) I am using the texturepackerGUI and the result is taking 2 files , one png (whicj contains all the images and one .atlas (and not .pack). 2) Now , I want ...
0
votes
0answers
373 views

TIled map rendering in libgdx

Good day. First of all, some explanation of situation. Init tiled map code: map = new TmxMapLoader().load("maps/map.tmx"); mapRenderer = new OrthogonalTiledMapRenderer(map, 1f / 32f); Rendering ...
2
votes
1answer
429 views

Recording and playing back sounds with LibGDX

How do I record a sound to PCM format and replay it from there?
3
votes
1answer
253 views

How to setup libGDX project only for Android & iOS?

I have developed some applications on android.But now i want to learn game development in Android & iOS with libGDX. I want to only develop for Android & iPhone.I do not want a desktop ...
1
vote
1answer
2k views

how to get width and height of TiledMap in the latest Version of Libgdx

I am making a tiled based game, I want not to let the camera show places, where there is no map... this is a obvious solution I got from a tutorial if(camera.position.x<400){ ...
1
vote
2answers
803 views

How do I use TextureRegion?

I can't understand how to use texture region. I have a png file which has images (sprite sheet) and I must "extract" every image I want. From here it just says TextureRegion(texture, 20, 20, 50, ...
0
votes
1answer
684 views

adding vertical scrolling to 2D platformer in libgdx

I am trying to make a two sided platform game in Libgdx. Where I am scrolling through the TiledMap. I was easily implementing the horizontal scrolling using.. camera.position.x = ...
-1
votes
1answer
220 views

no custom background - touchdragged method? [closed]

I am beginner in libgdx and trying to experiment .I am using the simple example here .So, I have 2 questions: 1) I want to use my background picture.So, I have a class Assets where I have all the ...
4
votes
1answer
906 views

Problem Implementing Texture on Libgdx Mesh of Randomized Terrain

I'm having problems understanding how to apply a texture to a non-rectangular object. The following code creates textures such as this: from the debug renderer I think I've got the physical shape ...
1
vote
2answers
805 views

Libgdx: Am I abusing Vector2? Is there a better way to do my position updates and rendering?

I'm simulating hair in a game. Currently I have a HairField object, which has a position defined by a Vector2. Each HairField has multiple Hair objects in a list, each with a position defined by a ...
6
votes
1answer
990 views

Generating a physics body for 2D Worms-like Terrain

I wrote a processing sketch that generates hills for a scorched earth clone, like this: I'm trying to figure out how to make this a physics object in libgdx, but I'm having problems figuring out ...
0
votes
1answer
318 views

Moving a Box2D object in the direction it is facing using applyForce [duplicate]

I'm trying to apply force to a polygon physics object to move it. Whilst I can get it to move upwards easily enough, I'm trying to get it to move in the direction in which it is pointing. Here's my ...
0
votes
1answer
361 views

Libgdx: setting windows's icon

When I export my game as runnable .jar file with custom window's icon - it doesn't run. It runs only in debug mode and when I try to launch .jar with console it says that it cannot load icon file. ...
-2
votes
1answer
135 views

How do I make a button that can only be pressed once / you can't hold it [duplicate]

I've created a button by checking if the left mouse button is being pressed and the cursor x/y are in the boundaries of the button but the issue is that if you even hold it down for longer than a ...
0
votes
0answers
108 views

libGDX TileMapRenderer not doing anything

I was using this tutorial and tried to make the TileMapRenderer work, but I can't. It never renders anything, no matter what i do. EDIT: I found out that the problem has nothing to do with the code. ...
6
votes
1answer
1k views

How can I achieve smooth shading / glow from one tile to another?

I've been working on a tile-based game in which some areas may be lit (currently seen), some may be black (never seen) and some may be dark (previously seen, but not currently seen). Looking at the ...
0
votes
1answer
210 views

questions about position and size

I am new to game development and I wanted to ask a question. I am reading the simple game example from here. 1) I want to ask why we define bucket.x = 800 / 2 - 48 / 2 ? How is that? Why not just ...
1
vote
1answer
303 views

Dealing with “jumping” sprites: badly centered?

Thing is, I've used darkFunction Editor as a way to get all the spriteCoordinates off a spriteSheet for each individual sprite, and parse the .xml it generates inside my game. It all works fine, ...
1
vote
1answer
88 views

Black areas on different screen sizes

I'm currently facing some problems with sprites/images on different screen sizes. For now the game stage is stretched to maximum width and height of the screen. In Samsung Galaxy S2, SGS3 and SGS4 ...
0
votes
1answer
1k views

libgdx keyboard input

I'm trying to figure it out how to check if keyboard key was released. I tried messing around with InputMultiplexer, InputProcessor, etc. Nothing helped. Not enough documentation from lib developers ...
2
votes
1answer
831 views

libgdx collision/picking

I am trying to make something with java libgdx (2D). One thing that I can't figure it out is how to check mouse intersection with (fore example) isometric textures that are not rectangle shaped ...
4
votes
2answers
390 views

2.5d with box2d - approaches from the top and bottom

So, I'm using box2d for my 2.5d game (think double dragon, tmnt arcade, castle crashers) where you can move around on the z-axis (faked as y-axis movement). Basically, I have box2d only doing ...
-3
votes
1answer
224 views

How does the Goomba know it has been jumped on?

I'm developing a 2D tile game engine in LibGDX and I'm asking myself how to structure the whole thing. One of the key questions right now is how to implement Player-Tile interaction similar to this ...
0
votes
2answers
1k views

What is the better way of generating levels in android game using LibGDX

I downloaded the source code of metagun for android from https://github.com/libgdx/libgdx/tree/master/demos/metagun/metagun-android The game uses a png image to create the level. It uses the ...
-1
votes
1answer
127 views

Android TCG structural design [closed]

I started developing tcg for android, using ADT bundle. What is the right approach/way for making/storing cards/game info, local sqlite, some kind of data file? some service? or something else?
1
vote
1answer
243 views

How can I implement an asset update/download in a libgdx application?

I am building a game based on libGdx and I want to be able to check for and download updated assets at some point before the player starts playing. The game is being built for PC and for Android. I ...
0
votes
1answer
173 views

Problem with Widget Event Reporting in Libgdx

So I'm trying to test an ImageButton on an Android device. I can get the button to appear on the screen, but when I press it nothing happens or appears on the log. Here is what I have in the Show() ...
4
votes
1answer
2k views

Confusion with Libgdx UI

I've started with Libgdx and am currently stumbling about trying to understand how to set up the interface. I have generated the base projects in Eclipse ( < proj-name >,< proj-name >-android, ...
2
votes
1answer
3k views

How do you implement Libgdx touchDragged?

I'm a beginner in Java and in Game Development too. I was following some tutorials, but now I'm stuck on implementing a touchDragged listener using libgdx, Can anyone suggest how to drag the image ...
-1
votes
1answer
194 views

Get distance between the edge of screen and a moving sprite

How to get the distance between the edge of the screen and a vector moving sprite? I want to get the distance between my moving sprite and the edge of the screen so that when my sprite touches the ...
1
vote
2answers
732 views

LibGDX GestureDetector touchUp

I am using to GestureDetector to detect drag gesture and determine vector based on position my finger first touched the screen and position when my finger left the screen. I already know that I can ...
1
vote
1answer
1k views

Drawing in 3D with LibGDX

Is there any way to simply draw in 3D, just like you would draw with ShapeRenderer or SpriteBatch? All I want is to draw circles that are in x.y.z coordinates, so some circles are far away from view ...
0
votes
1answer
885 views

Creating metadata/pack files for an existing sprite sheet

I've just bought Oryx's tileset pack: http://oryxdesignlab.com/sprites/ultimate-roguelike-tileset I use LibGDX (flixel-gdx to be precise). My question is, given this premade sprite sheet format, ...
1
vote
1answer
3k views

LibGdx : Animations not working on custom actor

I have this code for rendering a sprite, retrieved from a TextureAtlas public class SpriteActor extends Actor { private Sprite sprite; public SpriteActor(TextureAtlas atlas, String spriteName) { ...
1
vote
1answer
369 views

sharing preferences between two apps on android with libgdx

I am making an android game with both a demo version and a paid version. I want users who decide to buy the paid version to continue from where they left off, with all their old data and settings. ...
2
votes
1answer
656 views

LibGDX Cross Platform Networking

Backstory: I've been developing a game with LibGDX for the past two years, and I've seen it refactored more times than I remember. I jumped on the iOS iKVM port as soon as it was released. But I've ...
1
vote
1answer
206 views

How to attach one sprite to another in LibGDX?

I want to attach one sprite to another so that it is always located at the 'bottom' of the other sprite, regardless of how the main sprite is rotated.
0
votes
1answer
620 views

Deploying GWT application / LibGDX and TextureAtlas problem

I encountered with a little problem. After GWT (and LibGDX) deployment I got an error: GwtApplication: exception: Couldn't load image '/images/objects.png', file does not exist Couldn't load ...
4
votes
1answer
2k views

Libgdx sprite rotation (image quality)

This one is probably really simple but I didn't find a solution. I'm trying to create a widget (speedometer) with libgdx. For the arrows I'm using the setRotation() function. But when the image is ...
1
vote
1answer
188 views

LibGdx: How do I combine 2 GestureListener objects from 2 seperate classes into 1 GestureDetector

I'm trying to make 2 separate classes, 1 a VirtualJoystick class and 1 a VirtualButton class. I want to implement a GestureListener class in each, it just seems like good code to do so, but when I go ...