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.

I'm playing a video in Andengine on

@Override
protected void onSetContentView() {}

However, when I place a sprite on the screen at some point in time, it is placed behind that video view. I want it to appear in front of it.

My attempt:

Entity foregroundLayer= new Entity();
foregroundLayer.attachChild(drag1);
scene.attachChild(foregroundLayer);

Setting setZIndex also didn't work

Here's a screenshot:

screenshot

The world icon is half outside and half behind. It should be on top.

share|improve this question

1 Answer 1

It should be straightforward, I think:

  • Set Z index of your WorldIcon higher than VideoView.
  • Do scene.sortChildren() to apply the Z index sorting.
share|improve this answer
    
videoView is attached to layout and world icon is sprite attached to sceen –  random Dec 19 '13 at 3:51
    
OK . so your using layoutgameActivity? try to set contentView of video layout before attaching the sprite to scene –  asma.farhat Dec 19 '13 at 6:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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