1
\$\begingroup\$

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.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ NB: you may want to switch to libGDX. It's comparable, and AndEngine is not really maintained any more. \$\endgroup\$
    – ashes999
    Dec 14, 2014 at 3:12

2 Answers 2

0
\$\begingroup\$

It should be straightforward, I think:

  • Set Z index of your WorldIcon higher than VideoView.
  • Do scene.sortChildren() to apply the Z index sorting.
\$\endgroup\$
2
  • \$\begingroup\$ videoView is attached to layout and world icon is sprite attached to sceen \$\endgroup\$
    – KOTIOS
    Dec 19, 2013 at 3:51
  • \$\begingroup\$ OK . so your using layoutgameActivity? try to set contentView of video layout before attaching the sprite to scene \$\endgroup\$ Dec 19, 2013 at 6:27
-1
\$\begingroup\$

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

\$\endgroup\$
1
  • \$\begingroup\$ This is a link only answer. Links will degrade and become corrupt. It's always best to include relevant parts of the link in the answer. \$\endgroup\$ Dec 18, 2017 at 8:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .