Setting Higher Z-Index for Sprite

Posted by Siddharth on Game Development See other posts from Game Development or by Siddharth
Published on 2013-06-30T05:23:12Z Indexed on 2013/06/30 10:28 UTC
Read the original article Hit count: 836

Filed under:
|
|

For my game, I have to set highest z index for my sprite. At present, I wrote following code but didn't work for me.

    Sprite houseSprite = new Sprite(pX, pY,
            textureManager.houseBgRegion.deepCopy(),
            mVertexBufferObjectManager);
    attachChild(houseSprite);
    houseSprite.setZIndex(500);
    sortChildren();

My requirement did not satisfied with setting sprite in the HUD. So any how I have to apply highest z index. Also in my game sprites are dynamically generated as per game play.

So members please share your thoughts.

© Game Development or respective owner

Related posts about libgdx

Related posts about cocos2d