local topSpeedX = 4.8 local topSpeedY = 0 local mIDdleSpeedX = 1.6 local mIDdleSpeedY = 0 local bgSpeedX = 0.5 local bgSpeedY = 0 local voIDNode = cc.ParallaxNode:create() self:addChild(voIDNode) --近景层 local topSprite = cc.Sprite:create("heads/head_6.png") topSprite:setScale(1.0) topSprite:setAnchorPoint(cc.p(0,0)) --中景层 local mIDdleSprite = cc.Sprite:create("levelSelectScene/cloud_1.png") mIDdleSprite:setScale(1.0) mIDdleSprite:setAnchorPoint(cc.p(0,0)) --远景层 local bgSprite = cc.Sprite:create("game_bg1.png") bgSprite:setScale(1.0) bgSprite:setAnchorPoint(cc.p(0,0)) voIDNode:addChild(topSprite,3,cc.p(topSpeedX,topSpeedY),cc.p(200,800)) voIDNode:addChild(mIDdleSprite,2,cc.p(mIDdleSpeedX,mIDdleSpeedY),cc.p(0,300)) voIDNode:addChild(bgSprite,1,cc.p(bgSpeedX,bgSpeedY),0)) local go = cc.MoveBy:create(8,cc.p(-200,0)) local goBack = go:reverse() local seq = cc.Sequence:create(go,goBack) voIDNode:runAction((cc.RepeatForever:create(seq)))总结
以上是内存溢出为你收集整理的Cocos2dx_视觉差效果层ParallaxNode全部内容,希望文章能够帮你解决Cocos2dx_视觉差效果层ParallaxNode所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)