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

LibGDX 2D Silhouette

recently I decided to implement in my game the drawing of a silhouette of the player when he is behind objects (the top layer of the map). Found a similar question here, but it doesn't matter to me to ...
0
votes
0answers
103 views

How to change the border color of a button in libGDX?

How to change the border color of a button. I know how to change the background, but I don’t know this, although I reviewed the entire documentation. And is it possible to find out whether the button ...
1
vote
1answer
88 views

how to set volume of sound depending on the impulse a body receives in Libgdx / Box2d?

I am trying to set the volume of a bouncing sound of a ball depending on how hard the ball hits something. so the harder the ball hits a wall or a ground the more loud the bounce sound. I couldn't ...
0
votes
1answer
78 views

LibGDX How to adjust mouse aim angle calculation when screen is resized

I'm starting with a screen resolution of 1280 x 960 and that is the default resolution where mouse aiming is calculated thus: ...
0
votes
1answer
29 views

Incorporating HttpSession into libGDX communication

I wrote my server-side code prior to learning libGDX and writing my client-side code. Gdx.net provides for the http get communication I designed for, except for session authentication. I say that ...
1
vote
1answer
60 views

Libgdx - overlapping stages - textbutton unclickable

I've created a few TextButtons for a menu that render on top of another stage area, however the textbuttons that i've created for menu aren't clickable or don't provide any events. The MenuComponent ...
1
vote
1answer
217 views

setTransform() Box2D physics not working

It's my first time posting here! I'm working on a top-down shooter game in LibGDX and Box2D (so gravity is set to (0, 0)). At the moment, to move my character, I'm ...
1
vote
0answers
151 views

LibGDX Lights and Shadows for my 2D TiledMap Game (like Terraria/Starbound)

Im currently working on my Terraria-Clone. After I have finished generating the world, I would like to add light and shadow to my game. For example, it would be light in the Upperworld during the day, ...
0
votes
0answers
33 views

How to convert coordinates into local object coordinates in libgdx?

How to convert click coordinates (Gdx.input.getX (), Gdx.input.getY ()) to local object coordinates? The screenToLocalCoordinates method does not work and does not convert coordinates. current-some ...
0
votes
1answer
99 views

Parts of OpenGL rendering area missing/transparent until resize

I am having a weird transparency issue when running my game in windowed mode. Parts of the window, left and top parts in normal window mode, right and bottom when in maximised window, become ...
1
vote
2answers
192 views

Fixed timestep, updates per second keeps changing?

I've been trying to create a deterministic, fixed gameloop. The game loop should run TICK_RATE # of physics updates per second, and then render as quickly as possible (didn't do interpolation yet). ...
0
votes
1answer
50 views

LibGDX changing actors parents is resulting in unwanted (x,y) translation

I have a Rolodex of task item actors I want to drag to an agenda tablet. My drag and drop functionality is non-native, but came from modifying a book's implementation. The problem seems to be when I ...
2
votes
2answers
284 views

LibGDX Efficient way to reduce a vector's value gradually until it reaches 0,0

I can manage to achieve this but the code seems to be much longer than it should be. Velocity is given an initial value, either positive or negative and then is ...
1
vote
1answer
67 views

(LibGDX) Set actor to fixed position on TiledMap

How can I set an actor to an absolute / fixed position on my TiledMap, such that it does not follow the camera when I pan around? Currently my code looks like: ...
0
votes
0answers
230 views

RGB sequence of day/night cycle

I'd like to simulate a day/night cycle, and am thinking to do this with two components: an underlay to simulate sky color, accompanying either an alternating cloud or star rotation animation ...
-1
votes
1answer
293 views

How to make camera move with the player in 3D Libgdx

Iam trying to create a 3D game in Libgdx, so I created a 3d World with physics, and added just a small terrain and capulse (the Player) . I want to make the game first person, so I created a player ...
1
vote
0answers
76 views

How do I run LibGDX's Particle Editor in Netbeans?

I am trying to run the Particle Editor that comes with LibGDX in Netbeans. The gdx-tools-1.9.10.jar file shows up in my dependencies, and I can see all of the ...
1
vote
0answers
163 views

LibGDX Change mouse cursor to custom image......and keep it there

I'm able to create a custom cursor no problem using the following code running in my GameScreen's Show method: ...
1
vote
1answer
36 views

Libgdx opacity partial error

My model must support transfer textures but I can't do this using mesh + modelBuilder.part Opacity is tested correctly on only half of the model. ...
0
votes
1answer
146 views

Best way to make a Side Panel UI with Libgdx? (Java)

Take this image for example, the game is called Realm of the mad god, and it has this side panel filling the whole screen height with the player info. To reproduce it, Is there any way to make the ...
0
votes
2answers
83 views

Java LERP but with whole pixel values

I have a formula which returns a Lerp Vector3 value in integers but the problem is it never reaches the desired target value. It'...
1
vote
1answer
52 views

Need help converting LPDIRECT3DTEXTURE9 to openGl libgdx Pixmap

What i'm trying to achieve. I need to know the equivalent of LPDIRECT3DTEXTURE9 to openGL, the problem is I only know Pixmap ...
0
votes
1answer
178 views

LibGDX Letter spacing is reduced if I use GlyphLayout to draw a bitmap font

I need to use glyphlayout so that I can centre the text, but I found if I do the text gets distorted due to the spacing being incorrect. ...
0
votes
3answers
165 views

Class Not Found Exception on Class.forName()

I am having this exception on title. I have been following a LibGDX programming PDF, everything was working perfectly and then this code have been implemented, and it isnt working anymore. I should ...
1
vote
1answer
88 views

Drawing object lines in the Tiled map editor

Suppose I have this picture: I have a map like this created in Tiled already. I would like to draw collision lines (the green ones in the picture) without having to make it a polygon. As far as I ...
0
votes
1answer
33 views

When setting Stage as inputProcessor, Shaperenderer shapes are drawn stretched

I am working on making a falling sand simulation using libgdx. For drawing the individual elements I am using a ShapeRenderer and drawing rectangles. I have begun to implement a dropdown menu to ...
-1
votes
1answer
24 views

I have a menu with Textbutton but the buttons do not respond to the mouse

public class MainMenuGameScreen extends BaseScreen { ...
0
votes
0answers
57 views

libgdx images go out of proportion on some devices

I'm trying to develop a simple game using libgdx. The game works perfectly on emulator ( Nexus 5x API 26 x86 ). But when I generated its apk and tested on my phone(Samsung J7), the images somehow seem ...
0
votes
0answers
18 views

Body's initial velocity is too fast when created after minimax algo

I don't know if my question is right but I cannot address the real problem. I am dropping connect 4 game chips under gravity but when I apply minimax with a depth of 3, it starts with great velocity. ...
0
votes
0answers
35 views

What's the best type of Movement/collision detection for high-Speed games?

Before I begin I'd just like to make it clear that I am not familiar with many programming/development terms, so if anyone can link articles to any terms used it would greatly help things move along: ...
0
votes
0answers
110 views

How to send data from libgdx project to web?

I would like to work on moving the json data from libgdx to my web server, but I am not sure how to do it. The method below was created by referring to libgdx's documentation. ...
0
votes
0answers
25 views

Actor not scaling from center

I want to scale the start button from the center with initially scaled to 0.3 times. ...
0
votes
1answer
63 views

Box2d: crash on createBody in beginContact callback

I am getting this error on creating body in contactListener ...
0
votes
1answer
66 views

Box2d RopeJoint bug - fix or alternative solution?

What I am trying to do is to create rope game. Below you can find a movie how it looks like now. https://youtu.be/QTULCGNF70I I am using RopeJoint and I am reducing maxLength each frame to be able ...
0
votes
0answers
46 views

Libgdx storing rendered frames quickly to use them later

I have implemented a gif-button for my libgdx game that allows the player to store the last few seconds of gameplay as a gif. It works by storing frames in memory, and encoding them into a gif if the ...
1
vote
0answers
57 views

How to set orthographic camera for libgdx

I have implemented a basic demo of camera but it is not showing any sprites on screen. I cannot figure out what's wrong with my code. ...
0
votes
0answers
45 views

how to fill alpha with color?

model changes color completely: ...
0
votes
1answer
79 views

How do I make an actor move to the foreground temporarily in LibGDX scene2d?

I have an inventory UI which is a table in scene2d. Then the table had a bunch of Containers which are basically inventory slots. They have a transparant grey background color. Then in each container ...
0
votes
0answers
69 views

Game graphics taking too much memory of 0.5 GB

I am developing a simple 2D game. I have multiple sprites. Each sprite has around 80 png/frames of 265* 256. I used LibGdx's Texture packer to package the atlas. Am enabling mimap using following code ...
0
votes
0answers
42 views

Is using an anonymous inner class to determine game item behavior the right way?

I'm developing a little game that has a bunch of different items. I categorize the items in separate classes (consumables, armor, weapons) that all extend Item.class. Then I use one main Items class ...
0
votes
1answer
152 views

Libgdx, button onclick event crashes

I'm trying to create an android game using libgdx with a Titlescreen, you just press start and your game startes. However I'm having difficulty trying to get these buttons to work. The titlescreen ...
1
vote
1answer
271 views

Json Libgdx serialize / de-serialize a Object Map of Object Maps

Any one have any ideas on how I can serialize / de-serialize an ObjectMap<Enum, ObjectMap<String, Object>>(); (Object is usually a String Integer ...
0
votes
0answers
26 views

How to handling touchpad?

I have a touchpad. I tried touchpad.getKnobX> 0 and <0 (when swiping the knob left and right) the sprite still displayed but when I put touchpad.getKnobY> 0 and <0 (to swipe knob up and down) ...
0
votes
0answers
171 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
0answers
79 views

LibGDX Box2D, how to play an animation once, then set the state back

So, I've got some animations in LibGDX that I want to get running. Currently, the walking animations work perfectly, but attacking doesn't. I want the attack animation to play once, then set the State ...
0
votes
1answer
48 views

Alternative path not working

I am using Android studio (libGDX), and I can't figure out why alternative paths doesn't work. I've tried it as it said in the book, but it doesn't do anything, it shows a black window and than the ...
0
votes
1answer
87 views

testPoint not working - libgdx

I'm making a game like angry birds with LibGDX and box2d in which I want to drag a ball (instead of the bird) back before releasing it. I deploy with testPoint function: when I touch down the ...
0
votes
0answers
35 views

Libgdx Recoil Effect

I set -velocityX to my sprite gun. float velocityX = -20 * dt; if(trigger) { gun.setX(gun.getX() + velocityX); } I basically set a velocity of -20m/s to my ...
2
votes
0answers
872 views

How to sync entities in an ECS game?

I'm wondering how to engineer a client server sync of entities in a multiplayer game which is using an ECS. When the server changes some values of the components of an entity, I thought the best ...
0
votes
1answer
120 views

Render a sphere when the user clicks on the screen with libgdx

I’m really new to Libgdx, and decided to try out some codes to familiarise myself with it. I’m trying to write a program such that a sphere is rendered at the position of the user’s click. Here’s my ...

1
2
3 4 5
46