libgdx

How to make actors do the specific action one after another in Libgdx

帅比萌擦擦* 提交于 2019-12-13 19:45:26
问题 I've got three questions.>.< I have 2 actors(actor1,actor2), and an action(eg. ScaleTo). My willing is to make actor1 do the scaleTo firstly,and then(maybe after two seconds) actor2. Or randomly choose the actor to behave the action, and repeat the process n times. Are there any methods like squenceAction, but could be like this "sequence(Actor1.action,delay,Actor2.action,......)" Or is there be the timeline API which i can put the action of actor on several specific time points? 回答1: not if

Box2d :roll soft body ball

让人想犯罪 __ 提交于 2019-12-13 19:23:43
问题 I made a soft body ball int box2d that looks like that: Every point of the circle is a box2d body and every line is a distance joint. How can i roll it? I don't want to change the world gravity and just let it roll , I want it to start spinning from the center (not every circle point independent). I just need the geeneral idea ,not code. 回答1: The general idea is to apply the right force to each body. If you want rotation - these forces are normals to the vectors from the center of the ball to

Where is my APK stored when i run program on a android device?

不问归期 提交于 2019-12-13 18:41:27
问题 When i just run my program through eclipse on my device it gets installed (since i can open it again from my apps browser). However i cannot find the .APK anywhere. Is there a way to pre determine where my .APK goes? Otherwise how can i find the folder of an app from the app browser (using galaxy s4 )? I have tried searching for files using the ES file explorer app without results. 回答1: In your Eclipse, it will be under the /bin folder. In your device, your app will be in /data/app folder.

How to draw a hexagon map in libGdx using the Polygon class?

狂风中的少年 提交于 2019-12-13 18:38:59
问题 I recently asked this question on how to draw a hexagon in Android. After finding in the accepted answer that I would have to use umpteen lines of [repetitive] code (compared to the eleven when using regular Java Graphics and Polygon objects) I began to search for solutions. I found that libGdx has a Polygon class. I began trying to implement the code in the linked question (the code my question started out with) with slight modification, including replacing the graphics class. I stumbled

Collision detection management in Libgdx

我只是一个虾纸丫 提交于 2019-12-13 18:15:27
问题 After reading this: Managing Collision Detection I thought about how to manage it in libgdx as it supports other collision detection (using Intersector) and other classes you can use in game. I have the logic of my Objects with their properties (Zombie for example with moving Speed and health) and the appearance with the Textures, Position on Screen etc.( Zombie2d for example which is a subclass of Actor). The Zombie2d has also a reference to Zombie to have all the attributes of a Zombie. The

LibGDX touch coordination confusion

不羁的心 提交于 2019-12-13 18:01:24
问题 as I understood, libGDX coordinate system set by default, so the (0,0) is located at the bottom left corner, like in the following picture: (source: gyazo.com) Is it possible to make it work like JFrame, where the default position is at the top left corner? Anyhow, back to my actual question, android (OR at least my phone) touch coordinate system is working by full screen (when phone is laying on it's side) so the default (0, 0) position is located at the top right corner, like in the

What's the difference between LibGDX Sound and Music types?

只谈情不闲聊 提交于 2019-12-13 16:59:37
问题 What is difference between Sound and Music types in LibGDX? This worked both on desktop and Android: Music gameMusic = Gdx.audio.newMusic(Gdx.files.internal("sound/gamemusic.mp3")); gameMusic.play();: Sound gameMusic = Gdx.audio.newSound(Gdx.files.internal("sound/gamemusic.mp3")); gameMusic.play(); 回答1: Music is streamed, while Sound is loaded into memory. (Because Android with libgdx has limit of 1mb file for 'sound', Music can be of greater size) It is said so here: https://github.com

libgdx clickable image not working

时间秒杀一切 提交于 2019-12-13 16:58:52
问题 I have a menu screen in libgdx and I had a text button that started a new game like this. textButton.addListener(new ChangeListener() { public void changed (ChangeEvent event, Actor actor) { g.setScreen( new level1(g)); } }); It looked like crap so I changed it to an image. playbuttontexture = new Texture(Gdx.files.internal("data/playbutton.png")); playbuttontexture.setFilter(TextureFilter.Linear, TextureFilter.Linear); TextureRegion playbuttonregion = new TextureRegion(playbuttontexture, 0,

pause and dispose() not getting called in ApplicationListener in libgdx

佐手、 提交于 2019-12-13 16:58:50
问题 when I am calling exit() method in onDestroy() method of AndroidApplication, the pause() and dispose() of ApplicationListener were not getting called. Can anyone help me on this. 回答1: Got Resolved. While calling the listener from AndroidApplication and reverting back from it, I used to raise an Activity resulting that raised Activity was kept in pause. As of we know that paused can't be destroyed immediately. So dispose() was not called properly. Instead of raising activity, I used dialogue

Save and retrieve an image file in LibGDX

允我心安 提交于 2019-12-13 16:07:56
问题 How to Save and retrieve an image file in LibGDX. I want to save an image file in local storage in AndroidApplication class and retrieve it in my Core project. 回答1: The file handling in Libgdx is well describe in the libGDX wiki. In a nutshell: you are opening the file using FileHandle object that can be retrieved by calling one of Gdx.files.external("path.txt"); //files on SD card [Android] Gdx.files.absolute("path.txt"); //absolute path to file Gdx.files.internal("path.txt"); //asset