andengine

Android comprehensive failproof music service across multiple activities

醉酒当歌 提交于 2019-11-29 23:01:34
I know this question has been asked many times before and might seem to be a conglomeration of several questions, but I feel that it is relevant and important to many developers; I need to create a background music Service that can run across multiple activities for my Android game that ends when the application is terminated and pauses in all of the following circumstances: A certain Activity that has its own music is started. (Resume when this Activity finishes. This happens to be an AndEngine activity.) The home screen is pressed and the app is backgrounded, or the application is terminated

Displaying Ad In AndEngine

前提是你 提交于 2019-11-29 19:55:03
问题 I am trying to display an advertisement using Greystrip in AndEngine. I cannot figure out how this is done because it doesnt use a Layout to inflate views, but yet sprites. i use BaseGameActivity to create my application for each scene i would like to display adds on. In GreyStrip this is how they tell you to integrate ads in your application.. Before adding calls in your application to GSSDK, you need to incorporate the SDK into your AndroidManifest.xml. Add the following in the section,

ExceptionInInitializerError Physics World

别说谁变了你拦得住时间么 提交于 2019-11-29 16:42:26
I searched in a number of forums and it seems to be a common question. However i couldnt find a solution. I didnt do anything crazy so it seems stange that this happens. @Override protected Scene onCreateScene() { Scene s = new Scene(); PhysicsWorld mWorld=new PhysicsWorld(new Vector2(0, SensorManager.GRAVITY_EARTH),true); s.registerUpdateHandler(mWorld); final Sprite eliSprite = new Sprite(400, 240, james_walking[3], getVertexBufferObjectManager()); eliSprite.setScale(0.5f); s.attachChild(eliSprite); s.setTouchAreaBindingOnActionDownEnabled(true); return s; } I dont have much more to say

How to change TimerHandler delay in AndEngine?

别说谁变了你拦得住时间么 提交于 2019-11-29 15:49:44
问题 I have this method i create that adds a sprite to my andengine scene every second. private void createSpriteSpawnTimeHandler(){ TimerHandler spriteTimerHandler; float mEffectSpawnDelay = 1f; spriteTimerHandler = new TimerHandler(mEffectSpawnDelay,true,new ITimerCallback(){ @Override public void onTimePassed(TimerHandler pTimerHandler) { addFace(); } }); getEngine().registerUpdateHandler(spriteTimerHandler); } What i want to do is, for example if(x <= b){ mEffectSpawnDelay = mEffectSpawnDely -

Weird Exception when Livewallpaper is set in Android

拟墨画扇 提交于 2019-11-29 15:30:18
04-24 13:30:59.312: VERBOSE/RenderScript(6044): RS Thread exited 04-24 13:30:59.320: ERROR/libEGL(6044): call to OpenGL ES API with no current context (logged once per thread) 04-24 13:30:59.335: WARN/WallpaperService(6044): Ignoring updateSurface: destroyed 04-24 13:30:59.335: WARN/WindowManager(108): Window android.view.IWindow$Stub$Proxy@408968d0 is already added 04-24 13:30:59.355: DEBUG/dalvikvm(6083): GC_EXTERNAL_ALLOC freed 23K, 52% free 2598K/5379K, external 1625K/2137K, paused 55ms 04-24 13:30:59.425: DEBUG/GLWallpaperService(6083): onSurfaceDestroyed() 04-24 13:30:59.496: WARN

In App BIlling trouble with Pending Intents and switching activities

岁酱吖の 提交于 2019-11-29 15:22:20
问题 Ok so I have been trying to fix this for days, and I'm not coming here looking for someone to do my work for me as I have been troubleshooting and fixed every single error message in the LogCat. I am developing an Android game using Andengine (this might be part of the problem so being familiar with it could help). I'm not doing anything too fancy, my game activities are all single scene and don't have any Physics or anything like that, just a bunch of sprites and textures. I also used

What is maximum size of texture (Andengine)

萝らか妹 提交于 2019-11-29 14:06:27
What is maximum size of texture that should be used in andengine. I used this.diamondTexture = new Texture(2048, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA); When loading in device(HTC G1 T-Mobile) it shows blank screen. After reducing the image size and when replacing the above line with this this.diamondTexture = new Texture(1024, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA); Its running . Whats the problem ? Common approach - texture max size is 1024x1024. Some hi-end devices can handle 2048x2048 textures, but it`s better to use 1024x1024 size if you want your application to run on

How can i create a circle which has a number in?

倾然丶 夕夏残阳落幕 提交于 2019-11-29 12:39:53
问题 I'm programming an Android game using AndEngine. I want to create a circle which has a number in, like in this picture: 回答1: Something like this: circle.xml (in res/drawable) <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <solid android:color="#aaf" /> </shape> and circletext.xml (in res/layout): <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android

Cocos vs AndEngine for android [closed]

天涯浪子 提交于 2019-11-29 10:31:49
I want to make a game using Tiled Map Editor and I want to move the character around using a D-Pad for moving the character So I'm wondering which Engine would be better AndEngine or Cocos2d Keep in mind i'm a beginner at this so I'd like to stare at a lot of tutorials. :-D Thanks Both engines supprot loading TMX map quite easy and input from D-PAD. So if your requirements are only that, there is no big difference. Just use what you familiar with. vgonisanz Cocos2d-android don´t have support anymore. You must use cocos2d-x, cross-plataform, use JNI to use c++ code. More info HERE . Cocos2d-x

Unable to add AndEngine to Android Studio

痞子三分冷 提交于 2019-11-29 01:51:29
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 also tried adding the andengine.jar (file I just googled for) in /libs folder and do right-click -->