![]() Unless the tilewidth and tileheight are exact multiples of the area width and height, you'll see a border at the right and bottom where the tiles won't fit. You can access the calculated tile width and height like this: tiles = Partition(1200, 1200, 30, 30) # the point pos is the center of the tile Rectangular space such as a page into rows and columns (relative to current 0/0)Īreawidth and areaheight are the dimensions of the area to be tiled, tilewidth/ tileheight are the dimensions of the tiles. the x/ y point of the center of each tile in a set of tiles that divide up a.P = Partition(areawidth, areaheight, tilewidth, tileheight)Ī Partition is an iterator that, for each iteration, returns a tuple of: Which returns an array of points that are the center points of the grid. ![]() To use a Tiler to make grid points: first.(collect(Tiler(800, 800, 4, 4)) It's sometimes useful to know which row and column you're currently on: tiles.currentrow You can access the calculated tile width and height like this: tiles = Tiler(1000, 800, 4, 5, margin=20)Įllipse(pos.x, pos.y, tiles.tilewidth, tiles.tileheight, :fill) Tiles = Tiler(1000, 800, 4, 5, margin=20) for (pos, n) in tiles # the point pos is the center of the tile end Tiler lets you specify how many rows and columns of cells you want, and a margin Partition lets you specify the width and height of a cell The x/ y point of the center of each tile in a set of tiles that divide up a rectangular space such as a page into rows and columns (relative to current 0/0)Īreawidth and areaheight are the dimensions of the area to be tiled, nrows/ ncols are the number of rows and columns required, and margin is applied to all four edges of the area before the function calculates the tile sizes required. Tiles = Tiler(areawidth, areaheight, nrows, ncols, margin=20)Ī Tiler is an iterator that, for each iteration, returns a tuple of:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |