boundingBox getContentSize
来源:互联网 发布:游戏编程如何入门 编辑:程序博客网 时间:2024/05/16 02:32
boundingBox() ——如果你在一个Sprite(比如A)中加入一个子Sprite(比如B),则B通过boundingBox()获取到的边框,相对于父Layer来说,位置是不准的,这会导致明明按中了B,却得不到该有的响应。(少用boundingbox 可用contentSize代替引擎而已不需要全深入 好用就行)
getContentSize返回的是原sprite的大小
CCRectMake 由上面得到的size 制作rect包围盒
boundingBox 返回的是sprite大小(包括旋转,缩放,变换)——考虑了精灵的变形
p = m_Sprite->convertToNodeSpaceAR(p);
CCSize size = m_Sprite->getContentSize();
CCRect rect = CCRectMake(-size.width*0.5f, -size.height*0.5f, size.width, size.height);
CCPoint world_pos = m_object[i]->m_sprite->convertToNodeSpaceAR(pos);
CCSize size = m_object[i]->m_sprite->getContentSize();
CCRect rect = CCRectMake(-size.width*0.5f, -size.height*0.5f, size.width, size.height);
if (rect.containsPoint(world_pos))
{
- boundingBox getContentSize
- Cocos2d-x之getVisibleSize,getContentSize,boundingBox,getContentSizeInPixels,convertToGL,convertToUI
- Cocos2d-x之getVisibleSize,getContentSize,boundingBox,getContentSizeInPixels,convertToGL,convertToUI
- Cocos2d-x之getVisibleSize,getContentSize,boundingBox,getContentSizeInPixels,convertToGL,convertToUI
- cocos2d-x3.2中的getVisibleSize,getContentSize,boundingBox,getContentSizeInPixels,convertToGL,convertTo
- Cocos2d-x之getVisibleSize,getContentSize,boundingBox,getContentSizeInPixels,convertToGL,convertToUI
- getContentSize
- boundingbox回归
- cocos2dx getContentSize
- pku 2504 BoundingBox
- javafx.geometry.BoundingBox
- 绘制CCNode的boundingBox
- BoundingBox工具及其使用方法
- cocos2d-x 中 getContentSize
- getMapSize getTiledSize getContentSize
- getBoundingBox, getContentSize, getTextureRect区别
- Cocos2dx - getContentSize与getBoundingBox
- python : 修改boundingbox , 修改jpg
- JSON就是一个对象的数组
- 赶来
- SQL Server存储过程 对数组参数的循环处理
- android 启动模式
- Android Studio配置
- boundingBox getContentSize
- 用canvas实现图片滤镜效果
- HDLCompiler:413
- 20131030: 森林结构的运用(poj: 树的转换,电话号码,物质分解记录);带权并查集(食物链);C++输入;map的基本使用
- 随感
- mysql 连接url中useUnicode=true & characterEncoding=UTF-8 的作用
- jquery ajax php mysql 无刷新分页 demo
- 8 个必备的PHP功能开发
- Linux JIRA+MYSQL安装与调试方法