andengine

How to add a library in Intellij Idea

拜拜、爱过 提交于 2019-12-31 05:17:30
问题 I recently switched from Eclipse to Intellij. Now I'm trying to use the andengine library. In Eclipse it was easy to add libraries. Just right click > properties > add library. In Intellij there is no option when you right click a folder (see image). How can I add a project library (a folder, not a jar file) in Intellij? Thank you.. 回答1: Navigate to File > Project Structure , select Modules , and hit the plus button to add another folder (with source code). 回答2: Directly to the game engine to

Mp3 audio in the Android Assets folder fails to play from a signed and zip-aligned APK

拈花ヽ惹草 提交于 2019-12-30 11:10:49
问题 I am loading mp3 files to play in an Android game based on AndEngine. When I package my game as an APK, mp3 audio in the assets folder throws the error "can not be opened as a file descriptor; it is probably compressed." However, when I run the game using the run > button in Eclipse (MOTODEV Studio 3.0.2), the app is packaged, deployed to a device and the game has sound. Works perfectly on a device. If I package the app using "Export Android Application", which creates a signed APK ready to

Unable to add AndEngine to Android Studio

試著忘記壹切 提交于 2019-12-29 05:24:27
问题 I am trying to almost 2 days to add AndEngine to Android Studio but unable to do so. I tried the following two methods, neither worked. 1st Try I download the AndEngine code from GitHub Link -- this is NOT a Gradle Project and tried to add it to my Android Studio build.gradle and settings.gradle, but i get this error, my screenshot: https://postimg.cc/image/5mcvpvsar/ (I think I am getting this error because AndEngine is not a gradle project - HOW TO MAKE IT A GRADLE PROJECT??) 2nd Try I have

AndEgine/Box2d-How to move a dynamic body without using mouse joint?

梦想与她 提交于 2019-12-25 18:35:57
问题 I have tried a lot to find a solution for moving a dynamic body smoothly on the screen. Mouse Joint doesn't work for me, it has that rubber band effect that isn't useful for smooth movements. I have also tried to apply linear velocity to make the ball move, but couldn't do it so. What are the options to get a simple touch movement on bodies? For example, similar to Glow Hockey? The answer need not to be specific to AndEngine. Cocos2d would work for me as well. I've registered Touch listener,

Toasts in AndEngine Scenes

試著忘記壹切 提交于 2019-12-25 08:56:41
问题 I am using a scene manage and I have different classes extended from scene which are used to to display different modes. I am getting the prob in Toasting messages. In my Mode1 class extended from scene I want to show a toast message but it gives error that "Cant create handler inside thread that has not called looper.prepare()" I tried to do this inside handler but same result. I tried to make a static handler in main class but no result. Can any one tell me the solution? 回答1: You can create

ANDROID ANDENGINE — drag and drop stacked sprites

亡梦爱人 提交于 2019-12-25 06:25:49
问题 in my app I have some sprites that i need to drag and drop over the display. i defined the BitmapTextureAtlas and the corresponding TextureRegion, and then i'have created the draggable sprite from those data. Some sprites must be set in the same position and they have to be stacked. everything works fine except that the sprites seams to be stacked but when i touch an drag away one, instead of dragging the first on the top, it makes me drag away always the first on the bottom. how can i fix it

What is the purpose of setTouchAreaBindingOnActionDownEnabled - AndEngine?

蓝咒 提交于 2019-12-25 04:38:04
问题 I am starting to work with AndEngine and I see that some tutorials use setTouchAreaBindingOnActionDownEnabled but don't explain its purpose. Why I need to use this method together with onAreaTouched ? Should not be onAreaTouched enough and detect inside of it whether is DOWN or UP? Thanks 回答1: The purpose of the method setTouchAreaBindingOnActionDownEnabled is to be able to "Bind" the sprite/button/etc to a scene/hud. For example, if you only use the onAreaTouched for a controller in a race

How to set color of text letters individually?

不问归期 提交于 2019-12-25 03:47:15
问题 How would I make text so that each letter is a random color in andengine GLES 2? For the random color I could go int red = (int) (Math.random() * 254) + 1; int green = (int) (Math.random() * 254) + 1; int blue = (int) (Math.random() * 254) + 1; Color pColor = new Color(red, green, blue); but how can I set this to each letter individually? 回答1: each letter would have to be it's own Text and set each one's color randomly - just do it and when you create the Text , set the color to white on

Converting the code from SimpleBaseGameActivity to BaseGameActivity AndEndgine GLES2

人走茶凉 提交于 2019-12-25 02:32:11
问题 I'm fairly new to AndEngine Android programming and I don't know how to convert my SimpleBaseGameActivity code to BaseGameActivity. I want to convert it to match the tutorial i found on BaseGameActivity Splash + Menu tutorial so that I'll be able to merge it all. Here's the code for the Tower of Hanoi Game: public class MainActivity extends SimpleBaseGameActivity { private ITexture main_font_texture; Text countText; Font main_font; int movesCount; Scene scene = new Scene(); private static int

Drawing curved lines in AndEngine

北慕城南 提交于 2019-12-25 02:10:57
问题 I am new to AndEngine and very happy that it's very easy and exciting thing to do. Unfortunately I am unable to draw a curved line in AndEngine. Actually my scenario is that I have an animated sprite say Object. I want to move this object on a Line with the points given onToucing and dragging it. Now the problem is that I can't find any method to draw a line on points in a way that it does not produce corners. I want a smooth line with no corners. Suppose I touch the object and drag it on the