-
Notifications
You must be signed in to change notification settings - Fork 4
Mapdata
The mapdata module contains functions for iterating map data. Note that the orientation is assumed to be +x going right and +y going down.
mapdata.imageData(imagedata)
Returns an iterator which iterates through all pixels. The returned values for each iteration are x,y,r,g,b,a. Note that top left pixel starts at (1,1).
mapdata.string(string)
Returns an iterator which iterates through all non-space characters; each space character occupies 1 tile. The returned values for each iteration are x,y,char.
mapdata.array(array,width,height)
Returns an iterator which iterates through all values in the array. The returned values for each iteration are x,y,v. The width and height arguments are the dimensions of the map.
mapdata.grid(grid)
Returns an iterator which iterates through all values in the grid. The returned values for each iteration are x,y,v. The grid is row ordered such that v = grid[y][x].