libgdx

GestureDetector and InputListener in libgdx

人盡茶涼 提交于 2019-12-10 15:20:32
问题 I'm new to libgdx and what I'm trying to achieve here is that I want my GestureDetector to work at the same time with InputListener. I have two buttons on the left and I need them to keep reacting even if I start swiping at the same time(multitouch). I used InputMultiplexer but it doesn't work that way I need. I checked all the return values of InputListener and GestureDetector and everything that I need returns true, also GestureInputListener is a class that implements GestureDetector

Synchronous responses to `Gdx.net.sendHttpRequest` in LibGDX

白昼怎懂夜的黑 提交于 2019-12-10 15:11:00
问题 I'm making a small game in LibGDX. I'm saving the player's username locally as well as on a server. The problem is that the application is not waiting for the result of the call so the online database's ID is not saved locally. Here's the overall flow of the code: //Create a new user object User user = new User(name); //Store the user in the online database NetworkService networkService = new NetworkService(); String id = networkService.saveUser(user); //Set the newly generated dbase ID on

how generate multiple apk (using gradle , libGDX)

梦想与她 提交于 2019-12-10 14:47:57
问题 I try this I want generate few APK (x86, armeabi-v7a). In order to reduce the size of APK in Google Play But its doesnt work. Android studia says import com.android.build.OutputFile - Cannot resolve symbol 'OutputFile'. And in console i see. I try search in google other instructions and tried to do something about it myself, but I'm not good at gradle Error:Cannot invoke method multiply() on null object my gradle-file is // map for the version code ext.versionCodes = ['armeabi-v7a':1,

Libgdx use ScreenUtils asynchronously and don't stop the game loop

大城市里の小女人 提交于 2019-12-10 14:15:38
问题 I want to capture the screen. Libgdx provides some functions defined in the ScreenUtils class. For instance final Pixmap pixmap = ScreenUtils.getFrameBufferPixmap(x, y, w, h); My problem is that it takes about 1-3 seconds to get that information. During that time the game loop is blocked and the user will define it as a lag. Internally the ScreenUtils class, uses Gdx.gl.glReadPixels . If I run the ScreenUtils.getFrameBufferPixmap method in a thread, there is no lag, but it captures the screen

Scroll Listener on Scroll Pane Libgdx

自作多情 提交于 2019-12-10 13:59:34
问题 I am using a scroll pane to show a list of items. I want to add a Scroll Listener on the pane so that I can load more items Dynamically to the pane once it hits the bottom edge; I tried to add an InputListener and override onScroll but is not working for me 回答1: this is a simple test, I hope I understood your question In Your Class. ..// yourScrollPane.addListener(new EventListener() { @Override public boolean handle(Event event) { // TODO Auto-generated method stub System.out.println("Event

Apply pixel Coordinates to Screen Coordinates

两盒软妹~` 提交于 2019-12-10 13:57:20
问题 I'm trying to make an object appear where the person last touched. However when I try to do so it appears in the wrong place. I assume this is because of the fact the coordinates that the input returns is different to the display coordinates, my code is as follows: public class Core implements ApplicationListener, InputProcessor { //Has to be here otherwise the code formatting becomes buggy private Mesh squareMesh; private PerspectiveCamera camera; private Texture texture; private SpriteBatch

Gradle error after updating Android Studio to 1.5

♀尐吖头ヾ 提交于 2019-12-10 13:54:50
问题 Today I have updated my Android Studio to v1.5. I have libgdx project that works well until this update. Now I get this error message. Error:Unable to load class 'org.gradle.mvn3.org.sonatype.aether.resolution.ArtifactResolutionException'. Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) <a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The

libgdx TextureRegion to Pixmap

[亡魂溺海] 提交于 2019-12-10 13:23:38
问题 How do I create Pixmap from TextureRegion or from Sprite? I need this in order to change color of some pixels and then create new Texture from Pixmap (during loading screen). 回答1: Texture texture = textureRegion.getTexture(); if (!texture.getTextureData().isPrepared()) { texture.getTextureData().prepare(); } Pixmap pixmap = texture.getTextureData().consumePixmap(); If you want only a part of that texture (the region), then you'll have to do some manual processing: for (int x = 0; x <

`Leaderboard` tab not showing in Google Play Games while `Achievements` tab is there

风格不统一 提交于 2019-12-10 12:55:08
问题 I have enabled and added a leaderboard and achievements to my game. The leaderboard tab is not being displayed in Google Play Games, but the achievement tab is. I've read that the app needs to gain enough attention? What does that mean exactly? And how am I supposed to test this feature? This is an example from the web It shows the achievements tab, but as you can see, to the right, is a Leaderboards tab. 回答1: For your question it seems that you are trying to Find LeaderBoard in achievement

Draw curved custom object in LIBGDX?

时光毁灭记忆、已成空白 提交于 2019-12-10 12:52:06
问题 I've recently been looking into LibGDX and seem to have hit a wall, seen in the picture, the blue dot represents the users finger, the map generation it self is where i seem to get stuck, does LibGDX provide a method of dynamically drawing curved objects? I could simply generate them myself as images but then the image is hugely stretched to the point of the gap for the finger can fit 3! But also would need to be 1000's of PX tall to accommodate the whole level design. Is it such that i