local cache = CCSpriteFrameCache:sharedSpriteFrameCache()
cache:addSpriteFramesWithFile("c.plist", "c.png")
local sprite = CCSprite:createWithSpriteFrameName("c0000")
sprite:setPosition(ccp(100,100))
local animFrames = CCArray:createWithCapacity(15)
for i = 1,25 do
local frame = cache:spriteFrameByName(string.format("c%04d", i))
animFrames:addObject(frame)
end
CCDirector:sharedDirector():getScheduler():scheduleScriptFunc(
function()
local animation = CCAnimation:createWithSpriteFrames(animFrames, 0.3)
sprite:runAction(CCAnimate:create(animation))
end
, 4, false)
self.layer:addChild(sprite)
我想在定时器里执行某个动画,但是它确不执行,谁知道这个是什么原因呢