libgdx

Class not found using the boot class loader

半腔热情 提交于 2019-12-24 02:01:49
问题 there are a few questions out there about this, however I cannot get any of their solutions to work. Everything I've tried has failed, does anyone know what I'm doing wrong? Here is the error: 07-09 12:05:20.772 17337-17337/com.spaceshooter.game E/AndroidRuntime: FATAL EXCEPTION: main Process: com.spaceshooter.game, PID: 17337 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.spaceshooter.game/com.spaceshooter.game.AndroidLauncher}: java.lang.ClassNotFoundException:

Class not found using the boot class loader

落花浮王杯 提交于 2019-12-24 02:01:18
问题 there are a few questions out there about this, however I cannot get any of their solutions to work. Everything I've tried has failed, does anyone know what I'm doing wrong? Here is the error: 07-09 12:05:20.772 17337-17337/com.spaceshooter.game E/AndroidRuntime: FATAL EXCEPTION: main Process: com.spaceshooter.game, PID: 17337 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.spaceshooter.game/com.spaceshooter.game.AndroidLauncher}: java.lang.ClassNotFoundException:

libGDX: take screenshot inluding ShapeRenderer

跟風遠走 提交于 2019-12-24 01:16:20
问题 I'm trying to take screenshots in my libGDX game using the code from the official wiki. My render method looks like this: Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); shapeRenderer.rect(0, 0, screenWidth, screenHeight, topColor, topColor, bottomColor, bottomColor); shapeRenderer.end(); batch.begin(); // everything else batch.end(); if (screenshot) { takeScreenshot(); } But unfortunately, the ShapeRenderer rect in the background is missing in

LibGDX Multiply Vector2 with float value

[亡魂溺海] 提交于 2019-12-24 00:55:56
问题 Is there a way to multiply a Vector2 with a float value? I used to do this in XNA to calculate movement by multiplying a normalized direction vector with a velocity float. This pretty much is the last step in my code to make things work but there does not seem a multiply function for a Vector2 that accepts a float value. I could just mulltiply x and y manually but there should be a method for this i don't know about. 回答1: From http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic

libGDX: Hanging Rope [duplicate]

微笑、不失礼 提交于 2019-12-24 00:36:47
问题 This question already has an answer here : libGDX: Hanging rope knotted with some pivot (1 answer) Closed 6 years ago . I am new to android libGDX game engine and searching form many days to make a hanging rope, I also read out all the Box2D documentation, There is a method ropJoint but no enough explanation given to use it. Can any body help me to make a rope like this one. Hanging Rope in Box2d I also tried to search for some good libGDX book for android but couldn't find. your help is

LibGdx - Load skin from assetmanager

梦想与她 提交于 2019-12-23 23:03:47
问题 So I can load the skin in my assetManager like this: manager.load(skinAtlas, TextureAtlas.class); manager.load(menuSkin, Skin.class, new SkinLoader.SkinParameter(skinAtlas)); But if I want to add .ttf fonts at runtime how will I do this? i.e: skin = new Skin(); skin.add("smallFont", smallFontT, BitmapFont.class); skin.load(assetManager.getManager().get(assetManager.menuSkin, Skin.class)); //this does not work 回答1: If your Json styles don't rely on that particular font, you can add it to an

After rotation, sprite and rectangle position misaligned in Libgdx

风格不统一 提交于 2019-12-23 20:14:03
问题 I have following code, where closely mapped sprite, rectangle and polygon is been rotated at same angle in libgdx. After rotation rectangle is misaligned with the sprite. Although sprite is rotated when its drawn, the coordinates and dimensions stay same after the rotation. This is not the case for rectangle. Please see the code and results image below. public void rotate(int angle){ System.out.println("Before-recta x , y " + this.rectangle.getX() + " " + this.rectangle.getY() + " " + this

Why “No com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle registered with name: default” error is coming and how to fix it?

随声附和 提交于 2019-12-23 18:16:31
问题 When I am compiling LibGdx project I am getting the below exception. My question here is why it is coming and how to resolve this? Libgdx: 0.9.9 com.badlogic.gdx.utils.GdxRuntimeException: No com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle registered with name: default Json File { com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: default.fnt } }, com.badlogic.gdx.graphics.Color: { green: { a: 1, b: 0, g: 1, r: 0 }, white: { a: 1, b: 1, g: 1, r: 1 }, red: { a: 1,

Gradle finished with non-zero exit value 1

本秂侑毒 提交于 2019-12-23 18:10:28
问题 I just generated a project in libgdx and imported to eclipse, compiled a few dependencies and now I get this: Error:Gradle: Execution failed for task ':android:compileDebugAidl'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Progrmor\Workspace\android-sdks\build-tools\22.0.1\aidl.exe'' finished with non-zero exit value 1 I´ve tried refreshing gradle, installing the latest build tools etc, but this still remains. And here

Collection NoSuchMethodError when caling ,stream() method

僤鯓⒐⒋嵵緔 提交于 2019-12-23 17:40:09
问题 public int getColsBy(final Collection<Room> rooms) { return rooms.stream() .max((lhs, rhs) -> lhs.right - rhs.right).get().right; } I try to execute this code in my libgdx project, but all i have is exception! 04-15 22:34:21.136 32610-32636/com.mygdx.game E/AndroidRuntime: FATAL EXCEPTION: GLThread 8116 Process: com.mygdx.game, PID: 32610 java.lang.NoSuchMethodError: No interface method stream()Ljava/util/stream/Stream; in class Ljava/util/Collection; or its super classes (declaration of