This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
maxrects-lua [2021/02/13 08:20] muragami [:iterate(func,other)] |
maxrects-lua [2021/02/13 10:21] (current) muragami [:insertCollection(collect,sort)] |
||
|---|---|---|---|
| Line 88: | Line 88: | ||
| MyOtherRect = MaxRects.copy(MyRect) -- shallow copy of just the 4 indexes and two fields | MyOtherRect = MaxRects.copy(MyRect) -- shallow copy of just the 4 indexes and two fields | ||
| </ | </ | ||
| - | ===== Functions ===== | + | |
| + | ===== Functions | ||
| All the exposed functions of this module, with in-depth explanations. | All the exposed functions of this module, with in-depth explanations. | ||
| Line 108: | Line 109: | ||
| Creates a shallow copy of a rectangle. Does not duplicate .data for instance, but copies the reference. Explicitly only copies: [1], [2], [3], [4], .data, and .flip. | Creates a shallow copy of a rectangle. Does not duplicate .data for instance, but copies the reference. Explicitly only copies: [1], [2], [3], [4], .data, and .flip. | ||
| - | ===== Functions | + | |
| + | ===== Functions | ||
| ==== : | ==== : | ||
| Line 128: | Line 130: | ||
| Inserts a rectangle into the collection, using the algorithm to assign a location. If the rectangle can't fit, returns false. | Inserts a rectangle into the collection, using the algorithm to assign a location. If the rectangle can't fit, returns false. | ||
| + | ==== : | ||
| + | |||
| + | * **rect**: The rectangle to insert. X/ | ||
| + | |||
| + | * **return**: Boolean. True if the rectangle was inserted, False if it didn't fit. | ||
| + | |||
| + | Inserts a rectangle into the collection, using the algorithm to assign a location. If the rectangle can't fit, returns false. Copies .data into the stored node in the collection. | ||
| + | |||
| + | ==== : | ||
| + | |||
| + | * **collect**: | ||
| + | * **// | ||
| + | |||
| + | * **return**: Boolean, Number. True if all were inserted, False if only some fit. The number is the amount added. | ||
| + | |||
| + | Inserts rectangles into the collection, from an array table. If you define sort to one of: ' | ||
| ==== : | ==== : | ||
| Line 161: | Line 179: | ||
| Returns the algorithm in use by the packer. The options are: ' | Returns the algorithm in use by the packer. The options are: ' | ||
| + | ===== Simple LÖVE Texture Packer ===== | ||
| + | TODO! | ||