Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm playing a video in Andengine on

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();

Setting setZIndex also didn't work

Here's a screenshot:


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

share|improve this question
NB: you may want to switch to libGDX. It's comparable, and AndEngine is not really maintained any more. – ashes999 Dec 14 '14 at 3:12

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 – Diva 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

try this In short terms you have to rearrange rendering order.

share|improve this answer

Your Answer


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.