Created
November 11, 2013 07:48
-
-
Save xkyii/7409377 to your computer and use it in GitHub Desktop.
修改quick-x的部分函数
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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