Z order

Z order,第1张

概述一、看到cocos2d中有一段对Z order的介绍/**      * Sets the Z order which stands for the drawing order, and reorder this node in its parent's children array.      *      * The Z order of node is relative to its "br 一、看到cocos2d中有一段对Z order的介绍/**
* Sets the Z order which stands for the drawing order,and reorder this node in its parent's children array.
*
* The Z order of node is relative to its "brothers": children of the same parent.
* It's nothing to do with OpenGL's z vertex. This one only affects the draw order of nodes in cocos2d.
* The larger number it is,the later this node will be drawn in each message loop.
* Please refer to setVertexZ(float) for the difference.
*
* @param nZOrder Z order of this node.

*/

Z order用于表示node节点被描绘的顺序和记录它在父节点中的子节点数组中的位置。

node节点的Z order只是和当前的父节点的所有子节点的进行比较和起作用,具有局部性。

Z order跟OperGL的顶点无关,它只是cocos2d的节点的画图特性;

Z order越大,则表示节点在消息循环中被描绘的顺序越靠后;

可以使用setVertexZ对节点的Z order进行设置,node的nZOrder代表了node的Z order值;


二、setZOrder和_setZOrder之间的区别:_setZOrder仅仅是设置m_nZOrder的成员变量值;setZOrder先是首先设置m_nZOrder的值,然后记录该节点在父节点的子节点数组终端的位置---m_uOrderOfArrival成员变量;

总结

以上是内存溢出为你收集整理的Z order全部内容,希望文章能够帮你解决Z order所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1004029.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存