Unresolved reference: junit

I’m writing game using Kotlin and LibGDX framework. I’m new to testing. I have passed some basic tutorial how to create simple test. And how to configure gradle. I just clicked on class and choose create test. But, when i try to build project i get an error: e: /Users/maximternovtsi/bagel/core/src/test/test/BagelTest.kt: (1, 12): Unresolved reference: junit … Read more

libgdx-android: Intercepting back key and confirm exit

Using libgdx, how can I intercept the android BACK key in order to do some preprocessing (e.g. asking for confirmation from user), before actually performing the command to exit the game? Answer 1. Enable catching of Back Key. In the class that implements ApplicationListener @Override public void create() { … Gdx.input.setCatchBackKey(true); … } 2. Handle … Read more

Using the same font with different sizes in libgdx

I am using BitmapFonts, LabelStyles and Labels for my texts. I want to resize some labels, so I use this: fontType.scale(-.6f); LabelStyle style = new LabelStyle(fontType, Color.WHITE); titleLabel = new Label(“Points”, style); titleLabel.setColor(Color.RED); titleLabel.x = 260; titleLabel.y = 310; But when I want to resize another label, all the labels containing that font resize (I … Read more

android studio cannot resolve import org.json.JSONObject

I used libgdx to build my project and I am having issues using the JSONObject class. When I add import org.json.JSONObject, it says it cannot resolve. How do I add that library to my project? Here is what I have tried without success: I downloaded the json-simple-1.1.jar and put it in core/build/libs folder. Could not … Read more

Particle System libGDX [closed]

It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago. Can anyone give me a good example of … Read more

Error while importing projects

While importing projects into eclipse i have this error: Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory. Could not execute build using Gradle distribution ‘http://services.gradle.org/distributions/gradle-1.11-all.zip‘. As I have checked i need to set JAVA_HOME (i … Read more