I have some UI classes I made myself but I need a way to get them rendered on the Screen on one fixed place independent of the woorld and the camera moving. I just need it there. I am doing this in libgdx and I was wondering if theres a method that draws in relation to the screen coords and
Tag: libgdx
Planets won’t render when using for-loop in libgdx
I am running an N-body simulation (testing with three planets at first) and it appears when I use a for-loop to do so, all of the planets don’t render and while debugging i found out they don’t even have an address. However, if I manually type in the movement of all three planets it works. Here’s my code: It leaves
Orbit Simulator in Java returning odd values for velocity etc. despite correct math
I am using LibGDX to make an orbit simulator (elliptical as planets possess their own initial velocity) and I have the physics mapped out like so: The problem is that my planet wobbles around and doesn’t orbit at all. I fear my calculations in the code might be wrong as the physics are definitely double-checked and correct. Each celestial object
Libgdx Keep getting an error when I try to load a Tiled Map
I am relatively new to libgdx and I cannot figure how to fix this error I keep getting. I have tried multiple sources but none seem to work and I feel like there might be an error in my code. The error is… Execution failed for task ‘:desktop:DesktopLauncher.main()’. Process ‘command ‘/Users/rehan_samaratunga/Library/Java/JavaVirtualMachines/corretto-17.0.2/Contents/Home/bin/java” finished with non-zero exit value 1 My code is…
Can’t write to GL_RGBA32UI FBO texture on OpenGL ES
I have two GL_RGBA32UI FBO textures, which I use to store current state of particle positions/velocities per texel. The first I fill with data like this only once: Per render loop the second one is written to via a shader while the first is used as texture and the second as target. I do that by drawing a quad of
How Do I Convert This Java Code to Kotlin libGDX
I can’t figure out how to convert the ChangeEvent handler code from Java to Kotlin Answer
Box2D Fixture doesn’t get the same category and mask bits of its FixtureDef
This is quite bizarre in my opinion. I create fixtures based on a fixtureDef. I use the libGDX version of Box2D. This is my code: The output of this code is: WHAT? How can the filtering bits of my fixture not be the same of the fixtureDef they were created with? I have also found this out: The mask that
LIBGdx – I get gray pixels in a sprite when saving as PNG
I’ve been trying to scale down a sprite and save it to the android local store for later use, but everything I’ve tried always results in a grey edge around the sprite. Sprites As you can see, the sprite batch blend function is set to GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA and rendering to the screen look fine. It’s only when the PNG is
libGDX game complied to superDev on localhost:8080 only shows one button
I am unable to get my libGDX game in the browser using gradlew html:superDev After executing the command gradlew html:superDev on a terminal inside my IDE (Inteliji), I get the response: The code …
OpenGL Alpha values having no effect in shader
I have a simple shader to make scanlines in my 2d game which works fine and is as follows: #ifdef GL_ES precision mediump float; #endif varying vec4 v_color; varying vec2 v_texCoords; uniform …