在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
创建 local layer = cc.Layer:create() local layer1 = cc.LayerColor:create(cc.c4b(192, 0, 0, 255), s.width, s.height/2) --渐变 local layer2 = cc.LayerGradient:create(cc.c4b(0, 0, 0, 127), cc.c4b(255, 255, 255, 127)) --渐变 local layer3 = cc.LayerGradient:create()
绑定事件 local listener = cc.EventListenerTouchAllAtOnce:create() listener:registerScriptHandler(Sprite1.onTouchesEnd,cc.Handler.EVENT_TOUCHES_ENDED ) local eventDispatcher = layer:getEventDispatcher() eventDispatcher:addEventListenerWithSceneGraphPriority(listener, layer)
layer:registerScriptHandler(SpriteColorOpacity.onEnterOrExit) function SpriteColorOpacity.onEnterOrExit(tag) if tag == "enter" then SpriteColorOpacity.onEnter() elseif tag == "exit" then SpriteColorOpacity.onExit() end end
layer:scheduleUpdateWithPriorityLua(update,0)
|
请发表评论