cocos2d CCScrollView 解析

前端之家收集整理的这篇文章主要介绍了cocos2d CCScrollView 解析前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

CCNode 重要属性

m_obAnchorPoint = CCPointZero  
m_obPosition = CCPointZero 

#"whole screen objects. like Scenes and Layers,should set m_bIgnoreAnchorPointForPosition to true"

m_bIgnoreAnchorPointForPosition = false
m_obContentSize = CCSizeZero

CCLayer 和 CCScene 继承与 CCNode
并更改了上述部分属性

**CCLayer:**
 m_bIgnoreAnchorPointForPosition = true
 setAnchorPoint = ccp(0.5,0.5)
 m_obContentSize = winSize

#CCLayer加入了对外部事件的处理如触摸,重力,菜单按钮。
#默认CCLayer不处理外部事件
 m_bTouchEnabled(false),m_bAccelerometerEnabled(false),m_bKeypadEnabled(false),##CCScene:##
 m_bIgnoreAnchorPointForPosition = true
 setAnchorPoint = ccp(0.5,0.5)
 m_obContentSize = winSize

CCScrollView 继承自 CCLayer ,则继承下来的属性又 锚点为m_obAnchorPoint = ccp(0.5 0.5) 并且ignoreAnchorPointForPosition = true

猜你在找的Cocos2d-x相关文章