Questions tagged [libgdx]
'libGDX' is an open-source cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux, Mac OS X, Android, iOS and WebGL enabled browsers.
12,565
questions
0
votes
0
answers
6
views
Pausing a LIBGDX progress bar
I am trying to pause a progress bar. How would I go about it? I have a listener on a Pause button where I could do the pause but I cannot stop the animation.
Here is my progress bar code which works....
0
votes
0
answers
6
views
LibGDX - Box2D offsets the position of collision objects half the time
I'm working on a mobile game with a staggered isometric map, and I'm finding that Box2D seems to be drawing my collision objects with unpredictable results. My tileset has diamond shaped polys ...
0
votes
0
answers
21
views
Libgdx and android studio
EDIT: I fixed it, the problem was that I was not using the same android api and sdks as the ones used by libgdx.
I am trying to build my first libgdx project on android studio but I get an error:
A ...
1
vote
1
answer
37
views
LibGDX - Collision Detection | Collision Reaction | Collision doesn't apply to all?
I have parent classes that create shape entities and I can choose to make the entity a collidable entity or a Non-Collidable Entity.
So far, in this project, Circles and Rectangles are collidables. ...
0
votes
0
answers
11
views
Libgdx on AIDE- .ttf problems
I'm learning ligbdx and I got some problems in using "TrueType font" (ttf). I didn't know how to use it, I've tried how they use it in the tutorial, but didn't work. Please help a brother ...
2
votes
1
answer
36
views
LibGDX Label centering doesn't work properly after updating text
I have a problem. I'm creating a simple menu for my LibGDX game. I create a label as follows:
Label label = new Label("Text", new Label.LabelStyle(font, Color.WHITE));
label.setPosition(960, ...
0
votes
1
answer
25
views
Is there any possibilities to get coordinates of the specific area on the background image?
So i am new to libgdx and i am thinking about making 2D quest. I want to know how to interact with the objects on the backround image. For example, i have this location
Is it possible to get the ...
0
votes
0
answers
53
views
Why does my Update() method no longer work the moment I move it into a parent class?
I have three objects using the same functions and variables: just different images. So I decided to move them into a parent class called Entity. They still can render the same images and stuff but ...
1
vote
1
answer
45
views
Weird issue with Samsung keyboard on Android with Libgdx
In my game, when a textfield is touched, the view moves up along with the keyboard.
Here's the code in AndroidLauncher:
onCreate(){
//other codes...
setListenerToRootView()
}
private fun ...
0
votes
0
answers
11
views
gwt.xml file setup and placement for libgdx deployment to html
I am trying to deploy my LibGDX application to HTML but when running the dist task, I run into this error:
Loading inherited module 'com.physicssimulatoreisa.physicssim2dorbitsimulator.GdxDefinition'
...
0
votes
0
answers
17
views
java.lang.ClassNotFoundException: org.lwjgl.glfw.GLFWErrorCallbackI when running libgdx through bluej
I am currently making a game in libgdx through bluej. I have the latest jar files for libgdx in my +libs folder. Compilation is fine but once I run it I get this error: java.lang....
0
votes
0
answers
21
views
java.lang.SecurityException: sealing violation: can't seal package org.lwjgl: already loaded
I created a jar file with a library of code I want to re-use across projects.
I am using Maven to manage my code.
In the POM file for the library, I put this:
<dependency>
<groupId&...
0
votes
0
answers
29
views
I don’t see the exception code and the place in the code when an error occurs in a project under LibGDX (LWJGL3)
In my old project under LibGDX (LWJGL2), when an error occurred in the code and the desctop application was urgently closed, I saw the exact error in Android Studio. For example, with null pointer ...
0
votes
1
answer
30
views
Can't set config.forceExit in LibGDX (Lwjgl3)
Here is my Desktop Launcher code:
public class DesktopLauncher {
public static void main (String[] arg) {
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
...
0
votes
1
answer
22
views
Unable to build libGDX example https://github.com/libgdx/libgdx-demo-invaders out of box
It is running with Gradle 6.7.1 from gradle.wrapper and fails with:
./gradlew --gradle-user-home D:\Java\.gradle core:compileJava
Configuration on demand is an incubating feature.
> Configure ...
1
vote
2
answers
101
views
How to embed a 3D graphics panel (LibGDX or JOGL) into a desktop GUI (JavaFX or Desktop Compose) in 2022?
I am working on a 3D visualization tool as a prototype desktop app in Java/Kotlin.
I need the GUI power of JavaFX or Compose for Desktop (or Swing, worst case) but I need the main panel of the window ...
0
votes
1
answer
31
views
How do I draw a rectangular polygon without a triangular cutout?
I am creating a rectangular polygon that represents the box bounding the player sprite in a simple 2D game. This is the implementation I use:
float[] vertices = new float[] {player.getSprite().getX(), ...
0
votes
0
answers
22
views
I/Ads: Ad failed to load : 3 on demo ad unit android libGDX
I have an error code while trying to load ad:
I/Ads: Ad failed to load : 3
I use Demo ad unit from google: ca-app-pub-3940256099942544/5224354917.
It used to work before releasing my app for open ...
1
vote
1
answer
17
views
LibGDX (Android): How to select image from gallery and put into texture?
I am creating a game for Android using LibGDX, the task is to insert a profile photo from the gallery?
1
vote
1
answer
65
views
The size of the square is calculated incorrectly | Java libgdx
I am creating a game in which there is a 10x10 map and I need to calculate the size of these squares so that they all fit on the screen.
rect_x_end, rect_y_end The size of the square by x and y
...
0
votes
1
answer
71
views
how to add ( admob ) Interstitial ads to libgdx game and what activity to use?
I followed google guide:
updated build.gradle dependencies
updated AndroidManifest.xml
updated the AndroidLauncher and tried banner ads first
from libgdx wiki https://libgdx.com/wiki/third-party/...
0
votes
1
answer
48
views
How would I be able to create an enemy that shoots at the player after a certain amount of time in libgdx?
I am currently working on trying to make enemies shoot a projectile in a straight line at the player. The projectiles are not showing on the playstate.
public class Ghost {
private Texture ...
0
votes
1
answer
70
views
setCenter() Method is not properly centering sprite texture on box2d fixture
The past few days I've been trying to figure out a display bug I don't understand. I've been working on a simple 2d platformer with box2d and orthogonal Tiled maps. So far so good, the physics work ...
0
votes
1
answer
190
views
Ubuntu Libgdx problem - No X11 DISPLAY variable was set
My problem is with X11 variable - when Im trying to launch gdx-setup.jar i get output:
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set,
or no headful ...
1
vote
1
answer
61
views
How to cast Object to Texture in draw method?
I am learning to program with the LibGDX library according to one tutorial, but the tutorial is made on an older version of LibGDX. Most of it was the same as my version, I made some adjustments, but ...
0
votes
0
answers
20
views
MethodNotFound Exception on Box2DDebugRenderer java
Hello Im new with libgdx and Box2d
for learning purposes I tried to test basic features of libgdx and box2d in a simple android game
I made two bodies with 2 fixtures
one is rectangular shaped and the ...
0
votes
0
answers
32
views
Libgdx 3d particle error on initialization
I'm having a rendering issue for 3d particles created with the flame particle editor in libgdx.
I'm using a particle system to render 3d particles created with flame, I followed the tutorial in the ...
0
votes
1
answer
82
views
VSCode MacOS throwing libGDX -XstartOnFirstThread error
After I do the initial project setup and run it is throwing this error at me
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.lwjgl.glfw.GLFW.glfwInit(GLFW....
0
votes
0
answers
33
views
libGDX why does my fori loop not update Sprite position properly?
So I created an "UpdateShopPosition" method, that should place Sprites in correct spots on the screen. However when I launch it in the render method, it seems that every Sprite shares the ...
0
votes
0
answers
29
views
How can I symbolicate libGDX iOS crash logs?
I am debugging my libGDX game on a iPhone. Sometimes the app crashes and I get reports such as shown below. The reports are from xCode > Window > Devices and Simulators > View Device Logs. ...
1
vote
1
answer
42
views
LibGDX trying to create a method that handles click input on a sprite
So this is my code, the problem lies in the timer, I get an error saying that timesClicked is accessed from within inner class, therefore needs to be declared final.
However, if I declare it final, I ...
2
votes
0
answers
9
views
Input adopter stage not rending properly in screen
I have an abstract class which implements the screen interface. despite that stage instance properly added with in render method, screen stay frozen and thus stage instance wont properly react by time ...
0
votes
1
answer
41
views
Problems loading assets in libgdx
I'm new to the world of app development, but I already have some specific knowledge. But my issue is the following involving libgdx and Android Studio:
When trying to load a texture through the Assets ...
0
votes
1
answer
130
views
How to create new module (android library) into libgdx apllication? (if it is possible)
I created libgdx application with android module (kotlin - libktx) - I use: https://github.com/tommyettinger/gdx-liftoff
I tried to add new module (Android Library) in Android Studio, but it do not ...
0
votes
0
answers
42
views
How can I test the input handling of my LibGDX videogame?
I am developing a videogame in java using LibGDX, but the problem would remain also for a general-purpose application. I want to test how my game reacts to a given sequence of inputs (from keyboard, ...
0
votes
1
answer
44
views
Java game with libGDX: my ship cant move to the right
I'm doing a Java Project that consists of making a "Space Invaders" clone. I'm starting with the ship movement, searching on stackOverflow I found this code:
if(Gdx.input.isKeyPressed(Input....
0
votes
0
answers
12
views
LibGDX: black bar on top in immersive mode
I need to use immersive mode in my project, so I put this in my AdroidLauncher.java:
config.useImmersiveMode = true;
But I still have a black bar on top of the screen (as on screenshots below). How ...
0
votes
1
answer
13
views
Repeatable texture libgdx
I have a Texture and a TextureRegion with it inside. I want to repeat it in 1 direction and stretch in another. Any ideas how to do this?
If we want to repeat it in both directions we call
...
0
votes
0
answers
45
views
Add library 'Gradle:' to classpath in Android Studio
The project is a generated LibGDX project. It used to work fine, but when I updated to Android Studio Chipmunk, the android module din't work fine anymore. So recently, I've updated to the Dolphin ...
0
votes
0
answers
50
views
LibGDX's Model made with ModelBuilder not rendering
I'm learning to use LibGDX and my goal is to create a cube, with which you can control the resolution (number of vertices along each face). I already did that, and managed to use MeshBuilder to make ...
0
votes
0
answers
16
views
AudioUnitInitialize failed error on Mac OS
I was attempting to run a libgdx project that was cloned from a git repository. However, everytime I run the desktop launcher, I get the following error:
screenshot of error
I already edited the build....
0
votes
0
answers
95
views
I don't know how to structure my LibGDX Project in gradle to have a dedicated server jar
RN i am writing a game with LibGDX and its going great so far. I now want to implement a dedicated Server on my SBC (ODROID XU4Q) that handles all the gamelogic (Position, time, etc).
My first idea ...
0
votes
1
answer
32
views
Decal Batch doesn't work on all devices Libgdx
I tried rendering using Libgdx's DecalBatch on my phone and my friend's phone. It's rendering a 2D image with thickness.
A decal at the front and back side is created, then individual decals for every ...
0
votes
1
answer
50
views
AI Wander how to weight wander to return to spawn point
I have a function that returns a random wander force for an enemy AI using perlin noise but I want to know how I can 'weight' it so if it gets too far away from its original spawn point, it will ...
0
votes
2
answers
32
views
Make body borders invisible/different color
Java LibGdx Box2d
I would like to make body borders invisible or at least different color. One body should work as sensor and thus not be visible on the screen. I could not find a valid answer for ...
1
vote
0
answers
63
views
How to understand LibGDX crash logs on iOS device
My libgdx app crashes from time to time on an iOS device. I received the device log from xcode, but it does not highlight any exception cause. The log mentions the line where it crashes (object ...
0
votes
0
answers
35
views
Dependencies in an AIDE Libgdx project
I've been using AIDE with Libgdx to make a game. The problem is that when you create a Libgdx project in AIDE the project structure is different, for instance there are no build.gradle files, only ....
1
vote
1
answer
62
views
How to refresh a transparent screen in libGdx
I am working on a small libGdx project at the moment and I am facing now some trouble concerning a transparent screen. This transparent screen is called 'GameMenuScreen' because it can be called ...
0
votes
0
answers
28
views
How to localize Libgdx app name for iOS and RoboVM?
My LibGDX project runs on Android and iOS. The Android app name is specified in the manifest:
<application
android:label="@string/app_name"
...
So, it takes the app name from the ...
0
votes
0
answers
53
views
What is causing "UnsatisfiedLinkError: Can't load library" using libGDX on Linux
For a school project me and my team want to develop a game using libGDX in Java. So we set up the project with maven. The set up already included some basic code to which displays the libGDX logo on a ...