I'm trying to make an isometric game and I'm finding myself stuck with getting the correct draw order for my spine animations/skeletons.

I was able to use the depth buffer to get my sprites which use CCSprite to be drawn correctly by adding this code to the appDelegate.cpp:


(Also, when I say drawn correctly, I mean that if the sprite was behind a wall created in Tiled with cc_vertexz set at automatic; having it's Y-position greater than the wall's Y-position, the wall would be drawn over the sprite. Apologies for the run-sentence. See http://www.cocos2d-x.org/projects/cocos ... ki/TileMap for more info. )

However, when I am using spine animation/skeletons, they are always being drawn on top of walls even if their Y-position is higher than the wall. Is there any way to make the spine animation/skeleton work with the depth buffer much like a regular CCSprite does? Is there a way to make the sprites attached to the skeleton work with depth buffer?

Thanks for your time!
  • Mesajlar: 19


spine-cocos2dx uses a CCTextureAtlas to render. I'm not familiar enough with cocos2d-x to know how it works with the depth buffer. You should be able to modify things to work like you want relatively easily. Don't be afraid to jump into CCSkeleton.
Kullanıcı avatarı

  • Mesajlar: 12032

Dön Runtimes