Cocos2dx内的坐标系(Coordinate Systems In Cocos2dx)
来源:互联网 发布:java制作记事本 编辑:程序博客网 时间:2024/05/21 22:53
窗口坐标系:即openGL坐标系,左下角为原点,向右是x正方向,向上是y正方向。
纹理坐标系:左上角为原点,向右是x正方向,向下是y正方向。在使用图集时,例如截取其中的某个矩形块来创建一个sprite会用到此坐标系。
Window Coordinate System: which uses the openGL coordinate system, has an origin at the left bottom corner, x increases towards the rightside and y increases towards the upside.
Texture Coordinate System: which has an origin at the top left corner, with x increasing towards the rightside and y increasing towards the downside.This coordinate system will be used when you use a tileset, like using a rect from it to create a sprite.
code example:
CCSpriteBatchNode* batchnode = CCSpriteBatchNode::create("data/tileset/grass.png");CCSprite* sprite= CCSprite::createWithTexture(batchnode->getTexture(), CCRectMake(0,0,48,32));batchnode->addChild(bnsprite);this->addChild(batchnode);
The second line in this code fragment, created an sprite,using a 48*32 rect on the top left corner of the texture.
- Cocos2dx内的坐标系(Coordinate Systems In Cocos2dx)
- Cocos2dx内的坐标系(Coordinate Systems In Cocos2dx)
- Coordinate Systems in OpenGL
- cocos2dx 坐标系
- cocos2dx 坐标系
- cocos2dx坐标系
- cocos2dx坐标系
- cocos2dx 坐标系
- cocos2dx 坐标系
- cocos2dx坐标系
- cocos2dX--坐标系
- Cocos2dx-游戏开发中不同的坐标系,cocos2dx锚点
- Cocos2dx-游戏开发中不同的坐标系,cocos2dx锚点
- <一> cocos2dx不同的坐标系,锚点
- cocos2dx不同的坐标系,锚点
- cocos2dx坐标系介绍
- Cocos2dx-3.0坐标系详解
- COCOS2DX坐标系(下)
- Android 自定义progressDialog实现
- C++栈带来的思考
- 面试题:数组匹配
- 命令行转换fat/fat32 文件格式至ntfs
- 【PAT】1002. A+B for Polynomials (25)
- Cocos2dx内的坐标系(Coordinate Systems In Cocos2dx)
- android的AVD原始目录.android的移动
- 网线制作方法(RJ45水晶头接法)
- IE8设置默认浏览器
- 用XP连windows server 2008远程桌面登录失败,提示身份验证错误
- C++智能指针
- 隐含成员,及其存在情境
- NY--86 -- 找球号(一) [STL] [set容器]
- HDU 1084What Is..(简单模拟)