cocos2d draw polys over background
I added a background in my scene init,as a sprite. I'm drawing my game elements as polygons: ccDrawPoly. But the background appears on top of my polys which are thus rendered invisible.
Is there a way to get around this and show my polygons over the background?
Is there a way to get around this and show my polygons over the background?
Put the draw calls in a node that has a z order higher than the background.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Or reverse the order you draw the polygons. Or disable GL_DEPTH_TEST (if its enabled).
I figured it out!
the background has to be added with z of -1.
I think the draw method has a z of 0 by default. (I couldn't figure out how to increase the z of the objects drawn with draw.)
thanks everyone
the background has to be added with z of -1.
I think the draw method has a z of 0 by default. (I couldn't figure out how to increase the z of the objects drawn with draw.)
thanks everyone
Yes, the draw method is effectively called with a z of 0 and you can't change it. You can trigger the drawing from a subnode if you need more control over draw order.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| How max polys/vertex can I use for a game? | Eskema | 3 | 2,390 |
Aug 4, 2009 09:42 AM Last Post: Eskema |
|
| OpenGL - how to draw background image? | SDyer777 | 1 | 5,795 |
Mar 9, 2009 11:17 AM Last Post: AnotherJake |
|

