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

前端 未结 2 1100
野性不改
野性不改 2021-01-16 09:03

I have two layers. Each layer has a primitive drawing in it with OpenGL like this:

void Layer1::drawPolygon()
{
    glLineWidth(1);
    DrawPrimitives::setDr         


        
2条回答
  •  一生所求
    2021-01-16 09:43

    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.

提交回复
热议问题