API - 0leshe/imageAtlas GitHub Wiki

Main function

init(string:pathAtlas or number:width, string:pathConfig or number:heigth) table:atlas

string:path

We use this if we have ready atlas. At first argument we write path to atlas which is gonna be used. At second argument we write path to config file which is gonna be used for configure all pics what you have in atlas.

number:

We use this if we havent ready atlas, we create it. Arguments is width and heigth of our atlas, cannot be changed.

Init functions

atlas:setImage(number:x, number:y, table:image or string:path, string:name)

We adding picture in our atlas, picture will be placed in x and y positions and width, height will be setted automatically.

atlas:getImage(string:name) table:image

We getting picture from our atlas by its name. Return ready image.

atlas:save(path)

Saves atlas and config file to you path. Will be created 2 files, 'atlas.pic', 'config.cfg'.