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 video in andengine on

    protected void onSetContentView() {}

but when i place sprite in screen at some point of time it is placed behind that videoview but i need to appear on videoView in Andengine . plz suggest if any solution.

i hv tired : doing this

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

and setting setZIndex but didnt worked..

here is my screen :

enter image description here

the world icon is half outside and half behind ..I need that icon on top of VideoView.

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


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.