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
65 views

libgdx ScissorStack problem

Im making a user interface using libgdx I created a Window class & a Textfield class, that both use clipping. I use the ScissorStack class of libgdx for clipping. The Textfield is drawn inside ...
3
votes
1answer
100 views

How do you create a game overlay that makes the underlying graphics inactive?

I've created a simple game, and I drew a large rectangle in photoshop with faded edges that I want to use to overlay the game until the user presses "Begin" (on the overlay). The problem I'm currently ...
0
votes
0answers
35 views

InvocationTargetException caused by IllegalArgumentException due to trying to create a new OpenAL instance

So, after creating this class, (in this LINK) , I ran into a new problem, I recieved an InvocationTargetException, which is generally caused when a method is invoked and an exception is created when ...
0
votes
0answers
74 views

How to open another class by clicking on a button on libgdx?

I have a question about libGdx. I am making my own game, I have already made a splash screen and a main menu. I have made a button "Play" in my menu but I can't link it to my main game. however, I can ...
1
vote
2answers
218 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 ClickListener of the TextButton? If yes, how? Or should I use a different listener? ...
1
vote
1answer
142 views

Restarting a libGDX game to apply changes to resolution

How can I restart a LibGDX game to apply certain changes to the game such as changes to the resolution (going from 1920X1080 to 1280X720), or changing full screen. Granted the resize(int width, int ...
3
votes
1answer
200 views

Centering a textbutton in a table libGDX

I have a few Tables spread across a Stage, now I have a problem. In one table, all the TextButtons are centered, while in a different one they aren't, like this: Table 1 Table 2 XXXtextXXX ...
0
votes
0answers
48 views

scrolling texture in libgdx

I am making a game using libgdx I need to the space to go forever I have written code but it is not very effective take a look. Look at the code that I used to move the background but I want to use a ...
1
vote
1answer
90 views

Libgdx - Sprites disappearing [closed]

I'm facing a little problem and I have no idea to bypass it. I've made a dungeon generator and I'm able to spawn randomly mobs, the problem is that when they are not moving the game is fine, but at ...
0
votes
0answers
30 views

vertical lines on texture in libgdx

i am getting vertical lines on my texture even though i tried implementing texture filters,both linear and nearest and still i get the lines.how do i get rid of it? here is the code: package ...
2
votes
1answer
367 views

Libgdx - IsometricTiledMapRenderer and light shading

I am wondering if there is any way to simulate light shading in Libgdx using an IsometricTiledMapRenderer. Here is my code to draw an isometric map, it's able to be moved around with the mouse and ...
0
votes
0answers
55 views

Have button style not change when down

I'd like the button style to only change when it is checked and not change when it is pressed down, and/or have only the font color change. I'm using the built in Skin function with a .json file, ...
0
votes
0answers
97 views

Frame Buffer couldn't be constructed: incomplete attachment error on nexus 7

So I am running into an issue where I cannot load my game onto the nexus 7 because of the error stated previously. I read online that this is because the device can't use the Format class or something ...
0
votes
0answers
121 views

LibGDX scene2d button click not passing through to next input processor despite returning false

I currently have two input processors in my multiplexer, in the following order: Stage GameInput On the stage, I have an ImageButton with the up/down states set up correctly. Since the stage is ...
0
votes
1answer
186 views

Convert Screen coords to World Coords LIBGDX

I'm working on a tile based platformer game in libgdx. I'm having trouble getting the actual touch input coordinates when the aspect ratio of device is different from the virtual fixed aspect ratio ...
0
votes
2answers
84 views

Render character in bounding box

i'm rendering an attack animation with the following code: currentFrame = attackAnimation[3].getKeyFrame(stateTime, false); //3 : left, 2: right batch.draw(currentFrame, getX(), getY()); This ...
0
votes
0answers
125 views

ShapeRenderer is pixelated in libGDX

When I use a ShapeRenderer, it always comes out pixelated. But if I draw the shape in photoshop with the same dimensions, it's very smooth and clean-looking. My method is just as follows: package ...
1
vote
2answers
160 views

How to make an Actor follow my finger

I'm back with another question that may be really simple. I've a texture drawn on my spritebatch and I'm making it move up or down (y-axis only) with Libgdx's Input Handler: touchDown and touchUp. ...
1
vote
1answer
135 views

Dialog Title Does Not Fit

I successfully added my own font to the default .json file and it displays, however I get some weird sizing issues. Specifically when I try to create a Dialog. This is what it looks like: Ignore the ...
1
vote
2answers
132 views

How to render rounded shape perfectly?

I'm having issues rendering rounded shape figures. I have a Texture with different images in it and I get this whale figure from it with TextureRegion but the stroke of it looks pixelated. The ...
0
votes
0answers
82 views

How to add a flashlight in libgdx?

So I want to add a flashlight to the game when the game starts to get darker which I already have working. I bound a light texture to the batch and the first problem is that for some reason the ...
1
vote
0answers
83 views

Hiero Font not working [closed]

For ease of use I decided I would use the Skin class to make buttons and text, and the like, rather than draw them myself. So I downloaded Hiero to package a .ttf font into a BitmapFont and it all ...
1
vote
1answer
99 views

Why isn't my background drawing to the screen?

Ok, So I have a game I have been working on for a few months now and I am now stumped beyond belief. My friend who has spent days working on this background gave it to me and I put it in my game. On ...
2
votes
1answer
248 views

LibGDX collision detection on moving and rotating object (rectangle enemy) [closed]

i am trying to get collision dectection working properly but when i do it, the collision area keeps moving. no matter what i tried. there are 2 objects and the objects are moving and i cannot get the ...
0
votes
1answer
173 views

“Couldn't load font” LibGDX

yesterday I started working om making custom sized fonts to my game, in game, using FreeTypeFaceGenerator, and yesterday it worked fine, except an exception I was going to handle today. When I loaded ...
0
votes
1answer
243 views

Libgdx Do a fixed rotation for orthographic camera

Im trying to rotate my orthographic camera in the render loop to a fixed angle, but I can only make the camera spin with the code I got: in the create OrthographicCamera camera = new ...
0
votes
0answers
97 views

Black screen when switching from fullscreen to windowed mode with libgdx

I have just started working with libgdx, and have run into my first problem. I have a simple program that switches a desktop application from windowed mode to fullscreen and back again. If I start the ...
2
votes
1answer
579 views

How to match font size with screen resolution?

So I'm working on a game using LibGDX, and I have a problem. To make my game fit most resolutions, I created a base asset for each aspect ratio, for example, a main menu background image, I made it ...
0
votes
0answers
139 views

LibGDX stops drawing if I create a lot of Timer Tasks, but only in Android. Why is this?

I'm working on a few small games using LibGDX, and today I just started testing the first one on android rather than the desktop. A few seconds into the game, it stopped drawing. All my print ...
2
votes
1answer
97 views

Failing Screen Resize Method

So I want my game to draw to a specific "optimal" size and then be stretched to fit screens that are a different size. I'm using LibGDX and figured that I could just draw everything to a FrameBuffer ...
1
vote
1answer
154 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
1answer
84 views

Libgdx change color of Texture at runtime [closed]

i allready asked this on Stackoverflow, but i think this question may belong here. In a Libgdx game i have some Animations for my Player. All the Frames for this Animation are inside a TextureAtlas. ...
0
votes
2answers
141 views

Make objects slide across the screen in random positions

I want to make an object appear randomly at the right hand side of the screen and then slide across the screen and disapear at the left hand side. I am working with libgdx. I have this bit of code but ...
0
votes
1answer
131 views

LibGDX drawing map using tiles without space

I am making a board game. To draw the map on the board I use different tiles. On some screen the map looks good but on some other screens there is a space between the tiles. How can I do so there ...
0
votes
2answers
245 views

How to implement a simple bullet trajectory

I searched and searched and although it's a fair simple question, I don't find the proper answer but general ideas (which I already have). I have a top-down game and I want to implement a gun which ...
2
votes
1answer
84 views

libgdx arrays onTouch() method and delays for objects

i am trying to create random bullets but it is not working for some reason. also how can i make a delay so the bullets come every 30 seconds or 1 minute???? also the onTouch method does not work and ...
0
votes
0answers
81 views

Label not properly centered in TextButton

I'm using LibGDX v1.1.0 and I see that the label of a TextButton is not properly centered. I have the following code: m_resumeButton = new TextButton("resume", skin); m_resumeButton.addListener(new ...
2
votes
4answers
118 views

LibGDX - SpriteBatch's .draw() method requiring float[]

Please excuse my lack of knowledge with LibGDX, as I have just started learning it. I am going through some simple tutorials, and in one of them, I draw a string onto the screen like so: // the ...
2
votes
1answer
168 views

libgdx collision detection / bounding the object

i am trying to get collision detection so i am drawing a red rectangle to see if it is working, and when i do the code below in the update method. to check if it is going to work. the position is not ...
1
vote
1answer
76 views

LibGDX onTouch() method Array and flip method

How can I add this on my application. i want to use the onTouch() method from the implementation of the InputProcessor to kill the enemies on screen. how do i do that? do i have to do anything to the ...
1
vote
0answers
57 views

libgdx - Image artifacts when downscaling image

Why does this border appear around the edges when I downscale a bitmap and how do I avoid it? I tried every filter I know, the results go from bad to worse. Here's the original bitmap:
0
votes
2answers
153 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 ...
0
votes
1answer
133 views

How to prevent overlapping of gunshot sounds when using fast-firing weapons

So I am now trying to find sounds for my guns but when I grab a gun sound effect and play it in my game a lot of the sounds are either terrible sounding or have this horrible echoing effect because as ...
0
votes
1answer
81 views

How do I save my game with highscores and player positioning in LibGDX?

So I have a game that needs to save high scores for the number of waves, what guns the player has, positioning of the player and the zombies, and so on. I saw something about SharedPreferences but ...
0
votes
0answers
120 views

Libgdx - 2D Mesh rendering overlap glitch

I am trying to render a 2D circle segment mesh (quarter circle)using Libgdx/Opengl ES 2.0 but I seem to be getting an overlapping issue as seen in the picture attached. I cant seem to find the cause ...
1
vote
1answer
79 views

libgdx draw issue and animation

it seems as though i cannot get the draw method to work??? it seems as though the bullet.draw(batcher) does not work and i cannot understand why as the bullet is a sprite. i have made a Sprite[] and ...
0
votes
3answers
268 views

How to optimize collision detection

I am developing a 2D Java Game with LibGDX. This is what it kinda looks like (simplified): The big black circle is the player, which you can move by tilting the smartphone. The red circles and blue ...
1
vote
1answer
345 views

How to move Vector2 along angle?

These are my Vector2's that I am using for this function. public Vector2 position = new Vector2(); public Vector2 velocity = new Vector2(); public Vector2 movement = new Vector2(); public Vector2 ...
1
vote
1answer
275 views

libgdx rotation (animation, arrays) issues and help needed

well i am a noob at java and libgdx. i got the homing bullet working with the help of someone. now i am smashing my head as to how i can make it rotate so it faces the ball (which is the main ...
1
vote
2answers
99 views

what's wrong with my lookAt and move forward code?

so am still in the process of getting familiar with libGdx and one of the fun things i love to do is to make basics method for reusability on future projects, and for now am stacked on getting a ...