local sharedTextureCache = cc.Director:getInstance():getTextureCache()
local sharedSpriteFrameCache = cc.SpriteFrameCache:getInstance()

local imgs = {'14392.PNG', '14393.PNG', '14394.PNG', '14395.PNG'}
for _, img in ipairs(imgs) do
    local tx = sharedTextureCache:addImage(img)
    local rect = tx:getContentSize()
    rect.x = 0
    rect.y = 0
    local frame = cc.SpriteFrame:createWithTexture(tx, rect)
    sharedSpriteFrameCache:addSpriteFrame(frame, img)
end

local frames = display.newFrames("%d.PNG", 14392, 4)
dump(frames)

标签: Lua

添加新评论