libgdx

libgdx multiple objects implementing InputProcessor

懵懂的女人 提交于 2019-12-30 05:58:22
问题 So on my Screen I have two objects of the same class that implement InputProcessor with the following keyDown() method: @Override public boolean keyDown(int keycode) { if (keycode==fireKey) { System.out.println("Reporting keydown "+keyCode); } return false; } The problem is when I instantiate these two objects, only the last one instantiated receives any keyDown events. I need both objects (or however many there are) to receive keyDown events. 回答1: You need to use an InputMultiplexer to

Should I learn Android Studio before making game with libGDX?

情到浓时终转凉″ 提交于 2019-12-29 10:02:50
问题 I want to to make an Android game with libGDX but most of the resources that I found on the internet are using Android Studio (I don't know will it help, if I learn libGDX faster and better?), but I like using Netbeans and don't like developing the Android apps so... Can I learn libGDX without spending times for Android Studio? That's all, thanks! 回答1: LibGDX is cross-platform game development framework. Either you're developing an Android app or not, you should use Android Studio/

FileNotFoundException Android logcat errors

本小妞迷上赌 提交于 2019-12-29 09:45:10
问题 My game runs correctly when I test the desktop version, but when I launch an android emulator and and try to run the game on the emulator the game closes and I get the logcat errors: 10-28 08:00:53.528: E/AndroidRuntime(1203): FATAL EXCEPTION: GLThread 84 10-28 08:00:53.528: E/AndroidRuntime(1203): Process: com.mkgame.game1.android, PID: 1203 10-28 08:00:53.528: E/AndroidRuntime(1203): com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: playButton2.png 10-28 08:00:53.528: E

Opening LibGDX project in Eclipse (ADT Bundle)

元气小坏坏 提交于 2019-12-29 09:06:11
问题 Currently using ADT Bundle for Windows for developing Android applications. It has built-in a Eclipse IDE, and is easy and ready to use. (Just extract the .zip, no installing required) However, I want to develop a libGDX project using that Eclipse IDE. I have successfully generated a libGDX project using gdx-setup.jar. To import this generated project to Eclipse, this libGDX wiki says that in Eclipse IDE I should go to File -> Import -> Gradle -> Gradle Project But I don't find any Gradle in

libgdx android failed on launch

主宰稳场 提交于 2019-12-29 08:57:47
问题 This is my first time using libgdx and I would like to try the default application provided after the setup gdx-setup-ui . It runs fine when I hit the run button on eclipse as it has shown [2014-05-01 21:40:14 - my-gdx-game-android] Uploading my-gdx-game-android.apk onto device 'emulator-5554' [2014-05-01 21:40:15 - my-gdx-game-android] Installing my-gdx-game-android.apk... [2014-05-01 21:40:16 - my-gdx-game-android] Success! [2014-05-01 21:40:16 - my-gdx-game-android] Starting activity com

Scene2d how to handle touched actor?(LibGDX)

六眼飞鱼酱① 提交于 2019-12-29 08:45:47
问题 I have a problem with using scene2d in libgdx. I can't find anywhere a method that allows me to check wheter the actor is touched or not. I can only find methods that told me if actor was touched or released. In my game, when actor is pressed and hold, some things should be done every frame, not only in one moment that I put my finger on it. I want to stop the things when I release my finger. 回答1: You can keep track of this in your InputListener . Create a boolean field isTouched , set to

Google Play Games Services - Realtime Multiplayer - STATUS_CLIENT_RECONNECT_REQUIRED

↘锁芯ラ 提交于 2019-12-29 08:41:20
问题 I am trying to implement a real-time multiplayer in my Android game using the Google Play Games Services but I am facing an issue when the onRoomCreated method, that I overrided, is called. @Override public void onRoomCreated(int statusCode, Room room) { if (statusCode != GamesStatusCodes.STATUS_OK) { stopKeepingScreenOn(); showGameError(); return; } roomId = room.getRoomId(); showWaitingRoom(room); } The status code is always different of GamesStatusCodes.STATUS_OK and actually equal to 2 (+

Android Studio gradle 2.1.3 issue

雨燕双飞 提交于 2019-12-29 08:39:11
问题 Gradle Issue in Android Studio 2.1.3 I got those errors when i run the Desktop application that i've created based on the Tutorial. where i can find that Gradle 2.1.3? Please help me. Im using Libgdx framework. Thank you in advance. Error:Gradle: A problem occurred configuring root project 'Flapp Bird'. Could not resolve all dependencies for configuration ':classpath'. Could not find com.android.tools.build:gradle:2.1.3. Searched in the following locations: file:/C:/Users/Unknown/.m2

Cocos2D OR libgdx for Android Game Development [closed]

允我心安 提交于 2019-12-29 07:28:28
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I just want to know, that in the long run, using which of these engines will be better. Although I feel that using Cocos2D will be a

libgdx ScissorStack not working as expected

泪湿孤枕 提交于 2019-12-29 01:45:27
问题 I'm trying to create a "progress bar" of sorts but the clipping doesn't seem to work the way I expect it to. Is this something I am doing wrong or something I've misinterpreted? The draw() routine that should clip: @Override public void draw(SpriteBatch batch, float parentAlpha) { Rectangle scissors = new Rectangle(); Rectangle clipBounds = new Rectangle(getX(), getY(), getWidth() * 0.75f, getHeight()); ScissorStack.calculateScissors( getStage().getCamera(), getStage().getGutterWidth(),