标签:
spriteEx.lua function Sprite:playAnimationOnce(animation, removeWhenFinished, onComplete, delay) return transition.playAnimationOnce(self, animation, removeWhenFinished, onComplete, delay) end function Sprite:playAnimationForever(animation, delay) return transition.playAnimationForever(self, animation, delay) end
local MainScene = class("MainScene", function() return display.newScene("MainScene") end) function MainScene:ctor() local sp=display.newSprite("1.png",200 ,200); self:add(sp) local animation=cc.Animation:create() animation:addSpriteFrameWithFile("1.png") animation:addSpriteFrameWithFile("2.png") animation:setDelayPerUnit(1) sp:playAnimationForever(animation,1) sp:playAnimationOnce(animation, removeWhenFinished, onComplete, delay) end return MainScene
标签:
原文地址:http://www.cnblogs.com/yufenghou/p/4310044.html