libgdx

libgdx animation inside of a rectangle - collison detection - rectangles

馋奶兔 提交于 2020-01-22 03:31:07
问题 I am writing a RPG game similar to the style of Pokemon (top down view). I am now working on the issue of collision detection. I am wanting to create the collision detection based on rectangles. The problem is that i am having difficulty drawing the rectangle around the animation that i have previously set. I have searched Google and YouTube for a answer/tutorial of how to handle this problem yet found nothing. Player.class public class Player { public Vector2 position; private float

LibGDX How to put the game in the table? *** FIXED ***

不想你离开。 提交于 2020-01-22 02:31:06
问题 I have a game screen in which I want to implement both the game itself and the control buttons. I divided this screen into two parts using TABLE. The control buttons and the game are implemented in different classes. Everything works correctly, except for displaying the game. How to make the game fit in the top window? Game Screen code public class GameScreen implements Screen { private Main parent; private Stage stage; public static SnakeControl snakeControl; private SpriteBatch batch;

Error:Android Pre Dex: Android SDK is not specified

别等时光非礼了梦想. 提交于 2020-01-21 10:52:50
问题 I have downloaded gdx-setup.jar from website and I run it as: java -jar gdx-setup.jar I select the options that I want and generate project for idea (libgdx 1.6.2). When I click in generate button, the tool doesn't throw me any error. When I run idea 14.1.3 I go to File > Open... and select the ipr file generated. When I try to run desktop launcher, idea throw me the next error: Error:Android Pre Dex: [android] Android SDK is not specified I have tried with different build tools and API of

Difference between DEVICE_ID_EMULATOR and TEST_EMULATOR when testing Admob on mobile phone

做~自己de王妃 提交于 2020-01-21 05:45:28
问题 What is the difference between using TEST_EMULATOR and DEVICE_ID_EMULATOR? I want to test the admob ad system on my mobile phones, NOT on an emulator on the PC. AdRequest ad = new AdRequest.Builder(). .addTestDevice(com.google.ads.AdRequest.TEST_EMULATOR). .addTestDevice("YOUR_HASHED_DEVICE_ID"). .build(); AdRequest ad = new AdRequest.Builder(). .addTestDevice(com.google.ads.AdRequest.DEVICE_ID_EMULATOR). .addTestDevice("YOUR_HASHED_DEVICE_ID"). .build(); 回答1: The difference is that com

Libgdx How to get a list of files in a directory?

混江龙づ霸主 提交于 2020-01-21 02:43:06
问题 So I am trying to get a list of files in a directory with a file handle.list() method but it returns an empty list even though there are files in the directory. What seems strange to me is that it does work on the device but it does not work on the desktop. I think I know what the problem is but I dont know how to solve it though. In the method description it says "On the desktop, an FileType.Internal handle to a directory on the classpath will return a zero length array.", but there is no

Libgdx How to get a list of files in a directory?

风流意气都作罢 提交于 2020-01-21 02:43:06
问题 So I am trying to get a list of files in a directory with a file handle.list() method but it returns an empty list even though there are files in the directory. What seems strange to me is that it does work on the device but it does not work on the desktop. I think I know what the problem is but I dont know how to solve it though. In the method description it says "On the desktop, an FileType.Internal handle to a directory on the classpath will return a zero length array.", but there is no

Special characters in libgdx's textfield do not work

泄露秘密 提交于 2020-01-20 08:13:54
问题 I can use setText("åäö") but if I type on my keyboard it doesn't show up, this doesn't work either public void keyTyped(TextField textField, char key) { JOptionPane.showMessageDialog(new JFrame(), key); } The strange thing is that it doesn't work on mac but it does work on Windows, does anyone have an answer for that? Thank You! Here's another question with a similarly topic! How do you get input from special characters in Libgdx? I have tried to get the ascii value and puting it through Gdx

Special characters in libgdx's textfield do not work

坚强是说给别人听的谎言 提交于 2020-01-20 08:08:26
问题 I can use setText("åäö") but if I type on my keyboard it doesn't show up, this doesn't work either public void keyTyped(TextField textField, char key) { JOptionPane.showMessageDialog(new JFrame(), key); } The strange thing is that it doesn't work on mac but it does work on Windows, does anyone have an answer for that? Thank You! Here's another question with a similarly topic! How do you get input from special characters in Libgdx? I have tried to get the ascii value and puting it through Gdx

BodyEditorLoader - noSuchMethod

柔情痞子 提交于 2020-01-20 07:04:06
问题 So, I started using Physics Body Editor as an extension to libgdx . I also use Android Studio to compile my code, so I can run an app on a real device. But, unfortunately, as I create a new loader, like this: BodyEditorLoader loader = new BodyEditorLoader(Gdx.files.internal("tnkA.json")); logcat gives me the following error: java.lang.NoSuchMethodError: No virtual method parse(Ljava/lang/String;)Ljava/lang/Object; Clearly, something wrong with the Physics Body Editor . Is there any way to fix

Understanding libgdx

戏子无情 提交于 2020-01-20 02:26:25
问题 I understand that it is a framework; even more an open-source cross-platform game development library. I went to the libgdx homepage and followed the instruction on the video tutorial. After properly setting up my project I was able to run the default my-gdx-game project on the multiple supported platforms. Great, fine and dandy...now what? I have been scouring the forums, wikis, javadocs, and many many more sites looking for decent straightforward how-to's. Unfortunately I couldn't find any,