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
1answer
20 views

Crash when setting a new screen

In my almost finished game I want to set a new screen on game over. I got my game over method: private void gameOver(Label score) { for (Body body : worldBodies) { ...
0
votes
0answers
12 views

Java (libGDX) - Inheritance problems

I'm having some issues with inheritance for one of my libGDX projects, I'm making a game similar to (very stripped down) Terraria or Starbound and I am using the TiledMap to load the world, ...
1
vote
3answers
33 views

Rendering Tic Tac Toe Cross and Circle in libGDX

I am new in LibGDX. For learning purpose, I am creating TicTacToe and I spent two days to figure out what went wrong with rendering the cross and circle. Whenever I click on the cell, the cross and ...
3
votes
1answer
36 views

Why is libGDX's HexagonalTiledMapRenderer adding extra space?

Why are there large spaces between the hexes when rendered by HexagonalTiledMapRenderer? The tiles ARE black bordered, but that doesn't account for all the extra space. I was also able to get them ...
3
votes
1answer
36 views

Android TV game development

Anybody develop games for Android TV? Especially with libGDX? I would like to know what game controllers Android TV uses? And whether we can use libGDX to control the game controllers?
0
votes
0answers
7 views

Independent Column sizes in Scene2D Table in LibGDX

For my game's (mostly GUI based) UI i am using table from Scene2D in libGDX. I want independent column sizes in my table but first cell width is the width for all other rows in column. Is it possible ...
0
votes
1answer
30 views

dynamic body jumping out of water object

In my game I have my main object, a jetski, which will dive down into water, when the screen is touched. I managed to code the jetski diving down, with Box2d and some buoyancy forces. But when the ...
1
vote
2answers
17 views

applyForce as long as display is pressed

In my project I have my main character body. I want it to move down on the y-axis as long as the screen is pressed. I tried it with public boolean touchUp(int screenX, int screenY, int pointer, int ...
0
votes
1answer
13 views

How to rotate libGDX particle to face the direction of movement

I'm creating spark particle effect so I created simple horizontal spark texture. Here is what I currently have If I change rotation property, I get this But i want to rotate particle to face ...
0
votes
1answer
15 views

Black screen when launching on phone

I am coding a game in libgdx. While adding the background I used the html module to watch the results fast and easy on my computer. But when I try to see it on my phone I just get a black screen. My ...
1
vote
1answer
30 views

libGDX fileHandle cannot readString()

I have created a text file called "useraccounts.txt". All I want to do is to read the file using the filehandle class but I always get this exception: Exception in thread "LWJGL Application" ...
1
vote
1answer
52 views

2D grid based game merging boxes

Basically what i have at the moment is a tile based game with a grid containing a number of colored cells. this is what i've done so far The prinipal idea of the game is that the user has to ...
1
vote
2answers
34 views

Camera controll in Libgdx

I've a condition in my game where, I want my camera to follow the Player(its a body from Box2d) and in some not. This is the start screen of my game: Now, when i press a button(space) the player ...
0
votes
1answer
40 views

Stopping Actor tap/click event from propagating

I've been struggling with this for hours now and have read posts, docs and libgdx sources to better understand what's happening, but I still can't make any sense of this. I want to accomplish ...
0
votes
0answers
14 views

Scene2D: Dialog show with animations Sequence is also applied to the Dimming Background

I have issues with the dimmed Stage background when showing a Scene2D Dialog with Action Sequence (animations). The problem is that the animations are also applied to the dimming background and the ...
1
vote
1answer
17 views

Can't give my pictures the right location in libGDX

I have this code here sb.draw(title, (PPlane.WIDTH / 2) - (title.getWidth() / 2), (float) (PPlane.HEIGHT / 10)); sb.draw(playBtn, (PPlane.WIDTH / 2) - (playBtn.getWidth() / 2), PPlane.HEIGHT / 2); ...
2
votes
0answers
41 views

Dialog/event system in Java/libGDX

I hope that I'm posting this correctly as I'm new to the site, feel free to correct me if I'm in the wrong spot. As for my issue: I'm working on an 2D side-scrolling platformer game in libGDX, and ...
1
vote
1answer
25 views

How to draw a BitmapFont every user click

Im starting learning the libgdx framework and I want to "clone" some games. I know how to handle touch with if(Gdx.input.isTouched()) But how do I render new fonts every time user clicks on the ...
0
votes
0answers
14 views

DynamicBody diving into StaticBody

In my game I want a DynamicBody to dive down into a StaticBody. I set up both bodies. At the moment they are colliding. How can I get my DynamicBody to dive down? Is it going to work with this ...
0
votes
0answers
14 views

LibGDX - How can I write my own custom layout (E.g. table layout) [on hold]

I am currently developing a game and I got to a point where I realised I should use a layout for my screen, as it is going to get messy if I don't (both code and looks wise). Thing is, I do not want ...
0
votes
1answer
14 views

Polygons and actionlisteners Libgdx

I've been browsing these forums for a while now and I nearly always am able to find an answer without having to ask my own question! Such a great community! This is the first time I've been stumped ...
1
vote
0answers
17 views

LibGDX: How to detect remote button press for Android TV?

On Android TV, I need to be able to detect the remote control centre button to start the game. I tried: if (Gdx.input.justTouched() || Gdx.input.isKeyJustPressed(Input.Keys.SPACE) || ...
0
votes
0answers
17 views

Box2d Coordinate System

In the game I'm trying to code I got to have two bodies. One StaticBody and one DynamicBody. I want to have the DynamicBody on top of the StaticBody. Somehow all I get is this: Is it possible that ...
0
votes
1answer
17 views

libgdx(android) touchup triggers more than once?

I have a function I run inside the touchUp method but when I click with the mouse during emulation, it triggers my function multiple times. I don't think its an error with the called method itself ...
2
votes
1answer
27 views

Libgdx how to add popup interaction

I am looking for someone to point me in the right direction. I am working in libgdx. I have a game where a player will approach an object on a map and then interact with it. On interaction a new ...
0
votes
1answer
40 views

Libgdx Admob how to hide ad on specific screen?

I've recently started learning Java for android development. My first game is almost ready to publish in Google Play, but I'm affraid that google might say that on the one screen, the ad may be ...
1
vote
0answers
25 views

LibGDX on Android TV

Anybody wrote games for Android TV using LibGDX? What is the mapping of the remote control? Can we use the game controller with LibGDX? Thanks!
1
vote
1answer
57 views

Rendering Performance: num Draw Calls == num Texture Bindings

I'm making a game with Libgdx 1.6.4 and experience some lag issues on iPhone 4 and then discovered: // in the constructor GLProfiler.enable(); ... // in the render method Gdx.app.debug("draw ...
1
vote
1answer
25 views

LibGDX Deployment questions

A few questions from LibGDX newbie: How do you deploy a Mac/Windows app? If Mac app, can this be deployed to Mac App Store? Do you need to pay monthly (for RoboVM) for iOS development/deployment? ...
0
votes
0answers
19 views

libgdx html part in browser only shows libgdx logo

I am trying to run HTML part of libgdx. I followed its official guide https://github.com/libgdx/libgdx/wiki/Project-setup,-running-&-debugging I have installed GWT plugin, I did GWT compile and ...
1
vote
1answer
55 views

Box2d jetski on water

At the moment I am trying to code a 2d game in java, where a jetski is riding on water. If you press on the screen the jetski should dive down and jump back up on release. How do I have to do this in ...
2
votes
1answer
41 views

Viewport and Camera setting

For my first game in LibGDX and Android I got a Problem: I have a background picture which is 2560px * 720px. The screen is 1280 * 720. How do I have to set the viewport and camera in order to get ...
1
vote
0answers
21 views

Model a helium balloon on Box2D + libgdx [closed]

I want to make so that the bigger the balloon is, the faster it goes upwards, and if it's not big enough it will fall down. I tried applying a force greater than the gravity but it doesn't work as I ...
-1
votes
2answers
45 views

Removing default badlogic from desktop launcher [closed]

I'm making a game in java/libgdx. when I run the code in the desktop launcher it gives me a bunch of errors. All the errors are from the badlogic default package. My code: package ...
1
vote
3answers
72 views

Collision response and delta-time problems

I'm working on a 2d top-down shooter game. At the time, I am trying to get the movement and collision right, but I have a few problems with this. First of all, I am making my game frame independent ...
0
votes
0answers
48 views

Libgdx texture bleeding in tile map

So I am making a game in Libgdx using an isometric tiled map but when I set the texture filtering of the tiles to linear, black lines show up between all the tiles. This is caused because each tile ...
0
votes
2answers
63 views

Libgdx coordinate system

I just started with libgdx and I'm still figuring out how the coordinate system work.The code below would draw the image at [0,0] without the Orthographic camera What I can't understand is why the ...
1
vote
1answer
20 views

Libgdx particle editor absorb effect

I am trying to achieve a certain kind of absorb effect within libgdx via the particle editor. To be more descriptive: I want particles to spawn in a circle and then move towards the center point of ...
0
votes
0answers
29 views

LibGdx - APP42 Cloud API Java SDK - weird crash at insertJSONDocument

I'm using App42 Cloud API for saving user data. I created app in App42 console, added the keys in my code. But when I try to upload the data to the cloud, the app crashes. try { appStorage = ...
1
vote
1answer
24 views

libGDX upload z-axis of sprite to graphics card

Background: I want to obtain each fragments position via vertex interpolation to then calculate the light vector for phong shading (L = [Fragment pos] - [light source pos]). Problem: At the moment I ...
2
votes
1answer
24 views

LibGdx OpenGl prevent black part of Light mask texture from overlapping

I am using this masking texture for a dynamic lighting effect in my game: It looks beautiful until two lights begin to overlap: This is obviously because the textures are overlapping when I draw ...
2
votes
1answer
49 views

Keeping Android device awake [closed]

I currently program a game in which the user don't need to interact with the screen. Is there any way to keep the screen awake?
1
vote
1answer
113 views

Laggy empty project at 60FPS

@Override public void create() { batch = new SpriteBatch(); img = new Texture("badlogic.jpg"); } @Override public void render() { Gdx.gl.glClearColor(0, 0, 0, 1); ...
1
vote
0answers
54 views

LibGDX sound playing problem

I'm making a game and I want to play sounds in it. I have AssetManager which loads the sounds and I made a class which has playSound(String sound) method. This method calls the get() method of the ...
1
vote
2answers
43 views

Fading in and fading out animations

This is how I'm creating my player. Is there any way to start fading in and fading out for an amount of time when I get hit? private Texture tex = Game.res.getTexture("player"); public Player(Body ...
0
votes
2answers
23 views

LibGdx TextButtonStyle Offset not working correctly

I'm intending to give an animation to the TextButton by giving the pressedOffsetX and pressedOffsetY values: TextButtonStyle buttonStyle = new TextButtonStyle(); buttonStyle.font = font25; ...
1
vote
1answer
31 views

Multiple input not working properly

I have 3 different buttons, one for each action. I want to be able to jump and walk at the same time, but there's a little problem. jumpButton doesn't work while I'm pressing leftButton or rightButton ...
0
votes
1answer
34 views

ClickListener getTapCount() returns 0

I want to detect the double tap on a Container. If it is detected, then i have to remove the Actor associated with it. This is my first attempt: addListener(new ClickListener() { ...
1
vote
1answer
41 views

libgdx - Check if body is touch

I have some bodies around the screen(Ball[] balls), and I would like to delete them when user touches them. Also, I have an Image as userData of the bodies. I dont want to make a function to all ...
1
vote
1answer
38 views

LibGDX, BitmapFont strange position behavior

I'm using a Stage of LibGDX to draw a text, in my case the FPS. But after resizing, the position of the text does not behave properly. As you can see in the attached gif: The resizing function ...