Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5c09a9
commit 83c3ab4
Showing
7 changed files
with
79 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module(..., package.seeall) | ||
|
||
|
||
TKFrameInfo = {} | ||
|
||
function TKFrameInfo:new ( o ) | ||
o = o or {} | ||
setmetatable ( o, self ) | ||
self.__index = self | ||
return o | ||
end | ||
|
||
function TKFrameInfo:init () | ||
return self | ||
end | ||
|
||
return TKFrameInfo |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module(..., package.seeall) | ||
|
||
TKTextureMultiPack = {} | ||
|
||
function TKTextureMultiPack:new ( o ) | ||
o = o or {} | ||
setmetatable ( o, self ) | ||
self.__index = self | ||
return o | ||
end | ||
|
||
function TKTextureMultiPack:init () | ||
self.texturePacks = {} | ||
return self | ||
end | ||
|
||
function TKTextureMultiPack:addTexturePack ( pack ) | ||
table.insert ( self.texturePacks, pack ) | ||
end | ||
|
||
function TKTextureMultiPack:getFrameInfo ( frameName ) | ||
for i, pack in ipairs ( self.texturePacks ) do | ||
if pack.spriteNames [ frameName ] then | ||
local frameInfo = {} | ||
frameInfo.frameName = frameName | ||
frameInfo.quads = pack.quads | ||
frameInfo.resourceScaleFactor = pack.resourceScaleFactor | ||
frameInfo.index = pack.spriteNames [ frameName ] | ||
return frameInfo | ||
end | ||
end | ||
end | ||
|
||
function TKTextureMultiPack:release () | ||
for i, pack in ipairs ( self.texturePacks ) do | ||
pack.texture:release () | ||
end | ||
self.texturePacks = {} | ||
end | ||
|
||
return TKTextureMultiPack |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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