Primitives and sprites Z index in Cocos2D-x 3.0 is not consistent?

萝らか妹 提交于 2019-12-01 13:18:17
Pedro Soares

Due to the new multithreader renderer on cocos2d-x 3.0, drawing with primitives requires a different approach. Take a look at my reply at this thread:

https://stackoverflow.com/a/22724319/1468700

I believe there is a bug in cocos2d-x V3 beta 2 that makes primitive drawing always appear below all layers. It is fixed (I understand) in V3.0 RC

This is incorrect - there is no bug (I was mislead by other posts - my apologies).

See the post below for a link explaining what needs to happen to get primitives to draw in the 'right' z-order.

The summary is that all drawing operations are added to a queue in the game loop, then the queue processed - so you need to add your primitive drawing into the queue rather than drawing immediately.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!