Node类剖析

Node 类
1.绘图属性和变换属性 (锚点,坐标,大小,旋转,缩放,扭曲,透明度,是否可见。)
Z轴 setZOrder
缩放 setScale setScaleX setScaleY setScaleZ
位置 setPosition setPositionX setPositionY setPositionZ
扭曲 setSkewX setSkewY
锚点 setAnchorPoint
大小 setContentSize
可见 setVisible
旋转 setRotation setRotation3D setRotationQuat
旋转扭曲 setRotationSkewX setRotationSkewY setRotationX setRotationY
设置内部Z轴排序 setOrderOfArrival (非虚函数 不要手动改变)
位置对锚点的影响 ignoreAnchorPointForPosition
–Layer and Scene 默认为true 不能更改锚点 锚点为(0,0)。
–其他默认为false 可以更改锚点 默认锚点是(0.5,0.5)。
2.子节点 child
添加子节点 addChild
通过tag得到子节点 getChildByTag
通过名字获取子节点 getChildByName
搜索子节点 enumerateChildren
得到所有子节点 getChildren
得到子节点个数 getChildrenCount
设置父节点 setParent
getParent removeFromParent removeFromParentAndCleanup removeChild removeChildByTag removeChildByName removeAllChildren removeAllChildrenWithCleanup
设置子节点Z轴 reorderChild
排序子节点 sortAllChildren
2.节点数据
tag setTag
名字 setName
用户数据 setUserData
用户对象 setUserObject

3.GLProgram
setGLProgram   setShaderProgram  setGLProgramState

4.是否正在运行
    isRunning

5.lua脚本
 lua             scheduleUpdateWithPriorityLua

 6.生命周期
 onEnter
 onEnterTransitionDidFinish
 onExit

 7.停止所有计划任务和动作
 cleanup

 8.其他
 draw      visit    getScene   getBoundingBox   setEventDispatcher
 9.动作
 动作管理器   setActionManager
 运行动作  runAction
 stopAllActions  stopAction   stopActionByTag   stopAllActionsByTag   getActionByTag   getNumberOfRunningActions  numberOfRunningActions
 10.计划任务
 setScheduler
 isScheduled
 scheduleUpdate
 scheduleUpdateWithPriority
 unscheduleUpdate
 schedule
 scheduleOnce
 unschedule
 unscheduleAllCallbacks
 unscheduleAllSelectors
 resume
 pause
 resumeSchedulerAndActions
 pauseSchedulerAndActions
 update

 11.变换
 updateTransform
 ..........
 12.坐标转换
 convertToNodeSpace
 convertToWorldSpace
 convertToNodeSpaceAR
 convertToWorldSpaceAR

 convertTouchToNodeSpace
 convertTouchToNodeSpaceAR

 13.组件
 getComponent
 addComponent
 removeComponent
 removeAllComponents

 14.物理引擎
 setPhysicsBody
 getPhysicsBody
 removeFromPhysicsWorld
 updateTransformFromPhysics
 updatePhysicsBodyTransform
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值