libgdx

TweenAccessor for music.class in LibGDX

时光怂恿深爱的人放手 提交于 2019-12-01 18:20:40
I've been wondering: is it possible to use Universal Tween Engine in LibGDX to - for example - change the volume of a song? I wrote my own MusicAccessor with code similar to my SpriteAccessor, which actually works for Sprite.class, but when it comes to music objects - it always gets the same error: java.lang.RuntimeException: No TweenAccessor was found for the target The thing is, I DO register my accessor by: Tween.registerAccessor(Music.class,new MusicAccessor()); I'm quite sure it's actually being registered, as System.out.println(Tween.getRegisteredAccessor(Music.class)); prints: the.name

Couldn't load shared library 'gdx' for target

时光怂恿深爱的人放手 提交于 2019-12-01 17:47:39
I'm having the same issue as in this question , but the answers there doesn't solve my problem. I didn't create project by gdxsetup.jar, I just included gdx.jar and gdx-backend-android.jar. I added the libgdx.so to libs/x86, but it stills throws an exception. How should I solve this? Logcat: 02-16 11:59:45.604: E/AndroidRuntime(14788): FATAL EXCEPTION: main 02-16 11:59:45.604: E/AndroidRuntime(14788): java.lang.ExceptionInInitializerError 02-16 11:59:45.604: E/AndroidRuntime(14788): at java.lang.Class.newInstanceImpl(Native Method) 02-16 11:59:45.604: E/AndroidRuntime(14788): at java.lang

TweenAccessor for music.class in LibGDX

自古美人都是妖i 提交于 2019-12-01 17:31:27
问题 I've been wondering: is it possible to use Universal Tween Engine in LibGDX to - for example - change the volume of a song? I wrote my own MusicAccessor with code similar to my SpriteAccessor, which actually works for Sprite.class, but when it comes to music objects - it always gets the same error: java.lang.RuntimeException: No TweenAccessor was found for the target The thing is, I DO register my accessor by: Tween.registerAccessor(Music.class,new MusicAccessor()); I'm quite sure it's

Understand LibGDX Coordinate system and drawing sprites

不想你离开。 提交于 2019-12-01 16:57:57
So I am super stoked to start using LibGDX for my first android title for OUYA and PC, but I am running into some snags with LibGDX. (All of my questions can be answered by looking at source, but I am really trying to understand the design choices as well). To start with, the coordinate system. I created a project using the Project Setup jar, and it creates an OrthographicCamera like so camera = new OrthographicCamera(1, h/w); From my reading, I understand that LibGdx uses bottom left corner for 0,0 and yUp. Fine. I see that it is pretty easy to change to y down if I want to, but I am not

Importing gradle project, android error

最后都变了- 提交于 2019-12-01 16:33:13
I am trying to import a libgdx project (desktop, ios and android) to eclipse on my mac, which I have in my local git repository. When I try to import my project to eclipse ( Import >> Gradle >> Gradle Project, and then add my Root Folder for the whole libgdx project), I try to "Build Model", but then I get an error saying: "SDK location not Found. Define location with sdk.dir in the local.properties file or with and ANDROID_HOME environment variable" I have already set my ANDROID_HOME with export ANDROID_HOME=/Development/Tools/android-sdk-mac export PATH=$PATH:$ANDROID_HOME/bin but I still

Error:Android Pre Dex: Android SDK is not specified

六眼飞鱼酱① 提交于 2019-12-01 15:51:51
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 android (most of them throw me warnings when I pressed generate button from gdx-setup.jar ). I am using

Libgdx: Is there an easy way to center text on each axis on a button?

混江龙づ霸主 提交于 2019-12-01 15:45:43
I have been trying to figure out a way to center text on a button, but can't find an easy, multi-purpose way to. I can do it, but it will only work for a certain string, not for any string. i would like to know if there is a way to center any string on a button. My button in this case is 185x50. I have been able to center this button on the screen, like so: buttonX = WIDTH / 2 - (screen.getRegionWidth() / 2); buttonY = HEIGHT / 2 - (screen.getRegionHeight() / 2); Any help would be much appreciated. :) Updated the answer to libgdx version 1.7.1-SNAPSHOT: The easiest way to do this, is to use

LibGDX logging not showing up in logcat

半世苍凉 提交于 2019-12-01 15:17:13
I cannot get LibGDX logging to work in Android Studio. First i thought I had the same problem as my previous question but made sure my app updated on debug. playButton.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { Gdx.app.debug("BUTTON", "playButton Pressed"); optionButton.addAction(Actions.moveBy(-200, 0, 2)); } }); The test action on the option button is carried out but i cannot get the debug log to show up. The default Log level is LOG_INFO . For the Gdx.app.debug call to work, you must first call Gdx.app.setLogLevel(Application.LOG_DEBUG

Libgdx: Is there an easy way to center text on each axis on a button?

北城余情 提交于 2019-12-01 14:38:39
问题 I have been trying to figure out a way to center text on a button, but can't find an easy, multi-purpose way to. I can do it, but it will only work for a certain string, not for any string. i would like to know if there is a way to center any string on a button. My button in this case is 185x50. I have been able to center this button on the screen, like so: buttonX = WIDTH / 2 - (screen.getRegionWidth() / 2); buttonY = HEIGHT / 2 - (screen.getRegionHeight() / 2); Any help would be much

Libgdx Animation not working

白昼怎懂夜的黑 提交于 2019-12-01 14:34:08
I have been reading about libgdx and I have been stuck on this animation problem. I have reading about animation in libgdx from their github and when I run my app on my phone, the app crashes after the loading screen. Here is my player Actor that extends from Actor. I create the player actor in my menu screen class and add it to the stage. It is suppose to appear flying up and down in the menu screen but the app crashes. I know it is my player actor because when I comment out the player actor in my menu screen class the app does not crash. I use texture packer on my plane sprite and load it