Cocos2d坐标系统

来源:互联网 发布:au3写erp源码 编辑:程序博客网 时间:2024/06/08 14:31
Cocos2d中texture在opengl中的存储顺序:
(与textureRect.origion相同,与opengl uv坐标正好相反
左上点是(0, 0)
右上点是(1, 0)
左下点是(0, 1)
右下点是(1, 1)
在opengl中的存储顺序是:(0, 0), (0, 1), (1, 0), (1, 1)
cocos2d中texture在屏幕上的坐标系统:
sprite.textureRect.origion点是左上点。
在默认情况下(anchor点在中心),self.position是中心点。
一般的UV坐标系统:



所以说cocos2d中texture的uv点存储顺序刚好与正规的uv系统相反。