Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

In my game I want to create game over scene which is semi transparent so game scene become partially visible.

Game over scene contain several button that are not transparent but I need only background become semi transparent.

I have used scene management structure so people have to consider this also. I have already tried following things *) set background enable method to true *) create large rectangle up to screen size and set alpha.

But unfortunately about things not work for me. So please provide me some useful information about my problem.

share|improve this question
    
Can you clarify: do you want it to be semi-transparent over the android operating system or semi-transparent over other assets of yours? Also, what was wrong with drawing an image and setting alpha? (I.e., what about it didn't work?) –  Cameron Fredman Mar 13 '13 at 17:44
1  
Why is this tagged flash, cocos2d and andengine? –  bummzack Mar 14 '13 at 7:42
    
I consider any platform I work same trick used so I placed well know platform tag. I use sprite and set alpha of it but it only generate black background. –  Siddharth Mar 15 '13 at 4:14
add comment

closed as too localized by bummzack, Byte56, Sean Middleditch, Trevor Powell, Ali.S Mar 15 '13 at 23:28

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

up vote 1 down vote accepted

you can use simple dialog using layout file. in this you can set transparent background.

i find one temporary solution for your que. if you don't use background on scene then below code help you. in this you can set background as sprite.

Scene yourGameOverScene = new Scene();
yourGameOverScene.setBackgroundEnabled(false);
Sprite spriteBG = new Sprite(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT,
                    dBgRegion);
spriteBG.setBlendFunction(GL10.GL_SRC_ALPHA,
                    GL10.GL_ONE_MINUS_SRC_ALPHA);
spriteBG.setAlpha(0.1f);
yourGameOverScene.attachChild(spriteBG);
YourActivity.this.getEngine().setScene(yourGameOverScene);  
share|improve this answer
    
I don't want to use any android stuff because now I only want to concentrate on game engine power. can I use transparent image and set alpha? I already tested but after showing others view. I have to look it again. –  Siddharth Mar 14 '13 at 3:54
    
@Siddharth i update my ans, check it helpful or not. –  Divyang Metalia Mar 14 '13 at 4:59
    
I check this but it can't work so think about another solution for it. –  Siddharth Mar 15 '13 at 4:19
    
it work perfect in my game play. plz show your code. can i send demo ??? –  Divyang Metalia Mar 15 '13 at 4:23
    
yes mail me at siddharth3322@gmail.com. Thanks for your active attention. –  Siddharth Mar 15 '13 at 4:31
show 1 more comment

Is there any reason you cannot use a semi-transparent .png as your background image, then layer whatever else you need on top of that?

share|improve this answer
    
I also tried that one but it create whole background black. –  Siddharth Mar 13 '13 at 15:40
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.