I have successfully displayed an animation by using spritesheet(generated using TexturePacker). But when I set transparent background for the scene,it is not working! its displayed with black background. But for the other colors it is displaying the specified colors.
m_Scene.setBackground(new Background(Color.RED));//displayed with red Bg
m_Scene.setBackground(new Background(Color.TRANSPARENT));//displayed with black Bg
below is my full method onCreateScene() and my Activity extends SimpleBaseGameActivity
What could be the reason for this issue? can anyone help me to solve this ?
@Override
protected Scene onCreateScene() {
m_Scene = new Scene();
m_Scene.setBackground(new Background(Color.TRANSPARENT));
mTiledTextureRegion = getTiledTextureFromPack("sample");
mAnimatedSprite = new AnimatedSprite(0, 0, mTiledTextureRegion,
this.getVertexBufferObjectManager());
m_Scene.attachChild(mAnimatedSprite);
mAnimatedSprite.animate(160);
return m_Scene;
}
I have two activities "FirstActivity" and "SecondActivity". "FirstActivity" extends Activity and "SecondActivity" extends SimpleBaseGameActivity. What I'm doing is, I'm starting SecondActivity from FirstActivity on a button click.
public void onGoButtonCLick(View view) {
startActivity(new IntentFirstActivity.this,SecondActivity.class));
}
and the SecondActivity made as transparent in the manifest
android:theme="@android:style/Theme.Translucent"
Now the output screen displays transparent in other places but the scene area becomes black if set m_Scene.setBackground(new Background(Color.TRANSPARENT));
please check below link to see the output:
m_Scene.setBackground(new Background(Color.RED));
//displayed with red Bg
https://docs.google.com/file/d/0BwMxWp4Tk7MEUE53dEVnM3NoTlk/edit
m_Scene.setBackground(new Background(Color.TRANSPARENT));
//displayed with black Bg
https://docs.google.com/file/d/0BwMxWp4Tk7MEVWZYWGJDa3o2Ums/edit