Skip to content

Instantly share code, notes, and snippets.

@xkyii
Created November 11, 2013 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xkyii/7409377 to your computer and use it in GitHub Desktop.
Save xkyii/7409377 to your computer and use it in GitHub Desktop.
修改quick-x的部分函数
function display.newFrames(pattern, begin, length, isReversed)
local frames = {}
local step = 1
local last = begin + length - 1
if isReversed then
last, begin = begin, last
step = -1
end
for index = begin, last, step do
local frameName = string.format(pattern, index)
local frame = sharedSpriteFrameCache:spriteFrameByName(frameName)
if not frame then
if #frames > 0 then
break
else
echoError("display.newFrames() - invalid frame, name %s", tostring(frameName))
return
end
end
frames[#frames + 1] = frame
end
return frames
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment