加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

cocos2d CCScrollView 解析

发布时间:2020-12-14 20:42:04 所属栏目:百科 来源:网络整理
导读: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 = CCSizeZ

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读