Created
January 16, 2015 11:53
-
-
Save triplefox/b64eb859b4152dc5ae5c to your computer and use it in GitHub Desktop.
Data types for 2d sprite packing tool
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
type | |
DataEntry* = object | |
k:string # key | |
v:int # value | |
Rect* = object | |
x:int | |
y:int | |
w:int # width | |
h:int # height | |
d:seq[DataEntry] # metadata | |
AssetGroup* = ref object | |
rect:Rect # describes surface that assets are packed on | |
name:string | |
counter:int # start point for auto-incrementing ids | |
Asset* = ref object | |
p:Asset # previous version of asset | |
i:int # asset id | |
g:AssetGroup # group association | |
r:seq[Rect] # rectangles: 1st is boundary. | |
# additional are metadata, relative to top-left. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment