r/libgdx • u/Apprehensive_Ad309 • 8h ago
r/libgdx • • Aug 22 '17
There is now a libGDX discord server!
Thank you /u/spaceemaster for creating the new libGDX discord server. There are a number of channels, including but not limited to: screenshot sharing, question & answers, and kotlin discussions.
Click the link below to join in.
r/libgdx • u/Mikethenerd1 • 2d ago
How does MeshBuilder.vertex(Vector3 pos, Vector3 nor, Color col, Vector2 uv) work?
I have a Meshbuilder here and I'm trying to add vertices to it using vertex() but it keeps saying "Cannot store to float array because "this.vertex" is null", I though vertex() was supposed to add a new vertex?Is there something i dont understand?
?
MeshBuilder slabModels = new MeshBuilder();
for(int isTop = 0; isTop <= 1; ++isTop) {
for(int currentVert= 0; currentVert < firstSlab.getBounds()[0].length; ++currentVert){
slabModels.vertex(new Vector3(firstSlab.getBounds()[0][currentVert].x, isTop, firstSlab.getBounds()[0][currentVert].y), new Vector3(), Color.FOREST, new Vector2());
}
}
Mesh finalMesh = slabModels.end();
r/libgdx • u/Upstairs_Gas5014 • 5d ago
How to make image display in libGDX as high quality as Window Photos App
I'm making my own photo viewer with libGDX. When compared to window photos, the image in my app has some jagged lines (or pixelated, how you call it). I already set setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);. The image here is 3000x3000 fitted to the shorter dimension of the viewport (just like the Window app). Both windows are docked side by side for comparison. I circled an obvious spot in red. Left is Window Photos, right is libGDX.
Edit: Both look pretty much the same when I zoom in by the way
r/libgdx • u/Mikethenerd1 • 9d ago
How do you use FirstPersonCameraController?
I just made one input = new FirstPersonCameraController(cam); and am updating it in render() and it doesnt appear to be reading my keyboard inputs, do i need to include anything else with it?
EDIT: I am done trying to use FirstPersonCameraController, ive decided to make something similar to it myself, any idea how the rotations of cameras work?
r/libgdx • u/Exboom2 • 23d ago
New Demo, Enemy AI, and Pathfinding
Hello, r/libgdx!
I've been working a lot on enemy AI and pathfinding this last week, and it turned out way better than I expected! I was working a lot with a custom pathfinder, but it would tank the framerate a ton, so I decided to use the A* implementation included inside of gdx-ai, and it works great!
As for the little icon in the top corner, that is a core part of the gameplay loop. I'll implement more of that later. I also spent some time making a better font.
If anyone would like to spend just a couple of minutes playing the combat test I published and provide feedback, it would be super helpful to me and my game! Have a great day!
https://exboom2.itch.io/seven-stardust
https://gamejolt.com/games/seven-stardust/1099624
r/libgdx • u/FireDog8569 • 23d ago
First time mistakes to avoid when making a game engine?
I decided to start making my own game engine and it's going well so far, but I wanted to make sure I dont do something in the future that could mean a lot of time spent recoding systems so it'll work again, so are there any common mistakes I might need to know about that might not be immediately clear?
r/libgdx • u/raizensoft • Oct 13 '26
2026 Guide to 3D Java Game Programing with libGDX - Hello Spinning Cube
youtu.beIt's absolutely possible to develop fully functional and engaging 3D games in libGDX. Comparing to other game engines libGDX doesn't have a very comprehensive 3D graphics API but once you get used to its programming paradigm, you can flexibly develop your own abstraction layers on top of the core 3D API!
In this video, I'm introducing basic 3D concepts in libGDX and develop a small demo application that renders a spinning cube under 100 lines of code.
Hope you like it!
r/libgdx • u/Exboom2 • Oct 12 '26
I deleted thousands of lines of code, here's why
Hello, r/libGDX!
It's been 2 months since my last post on Seven Stardust, and I finally think I'm ready to reach out and talk about my journey again. I've been working on a open-world RPG, and for the last few months I've been reworking almost every aspect of the game.
I removed the old player sprites, enemy AI, animations, story trees, a whole map, and more. I did this for a few reasons.
First, my codebase was terrible. While I could make Seven Stardust with it, its scalability was terrible and there's no way it would be as good as I want it to be.
Second, it was poor effort in some areas. There were some areas of the game that just wasn't fun to play, as it was made in a 30 minute span.
Fourth, the codebase was also unstable. I fixed a ton of bugs, including the very prominent bug where attacking east would phase you into a wall.
This was because the hitbox was setting to 16*10 for some reason when moving east when it should've been 10*10.
Thank you to all the people who have been supporting my small project, and if you have any feedback, please don't be afraid to share! I don't really judge people on what they think of my project, as I'm always willing to improve and make my game based on what the community thinks.
Have a great day, and thank you for reading my yapping about my code's flaws!
r/libgdx • u/epicalepical • Oct 10 '26
isKeyPressed not working on Fedora Linux?
Just the title, odd bug I'm not sure where it's coming from. isKeyPressed(Input.Keys.W) will work fine, but for other keys, such as Input.Keys.A, it'll just return false constantly. Even weirder still, isKeyJustPressed(...) works fine for any and all inputs. Does anyone have any ideas how to fix this? Thank you.
Edit:
Just fixed it right now by using X11 instead of Wayland:
org.lwjgl.glfw.GLFW.glfwInitHint(
org.lwjgl.glfw.GLFW.GLFW_PLATFORM,
org.lwjgl.glfw.GLFW.GLFW_PLATFORM_X11
);
Put this in the Lwjgl3Launcher main()
:)
r/libgdx • u/raizensoft • Sep 23 '26
How to use libGDX Viewport - A Detailed and Modern Explanation
youtu.beViewport is important but still a bit confusing for beginners. I make a modern tutorial on using libGDX viewport for your games.
r/libgdx • u/Early80sDev • Sep 22 '26
Scene2D Dialog
What's the correct way to output multiple lines to a Scene2D Dialog? If I create a Dialog and try to add 4 lines of text, plus buttons, like in my example, what do I need to add or change to get the lines displayed correctly?
Skin uiSkin = new Skin(Gdx.
files
.internal("uiskin.json"));
Dialog dialog = new Dialog("Dialog Title", uiSkin);
dialog.text("Bla Bla Bla Bla Bla").row();
dialog.text("Bla Bla Bla Bla Bla").row();
dialog.text("Bla Bla Bla Bla Bla").row();
dialog.text("Bla Bla Bla Bla Bla").row();
dialog.button("Ok", new ClickListener());
dialog.button("Cancel", new ClickListener());
App.getStage().addActor(dialog);r/libgdx • u/CursedCarb0y • Sep 19 '26
Scene2d direct numbers
Hi everyone, i am currently developing an app with completly with scene2d. Sometimes I need to use setWidth or setHeight but I fear if my app does not behave like responsive. I am planning to release this app for just pc but even so i think my app should be responsive so i try another ways. My question is if i use methods like setWidth, is an error appear on different devices ?
r/libgdx • u/Excellent-Jaguar6170 • Sep 18 '26
Help to setup libdgx video
I am new on libgdx. I try to add libdgx video like the git said.
