Initializes the atlas of a given size. Clears any previously added nodes. This won't invoke OnFree for atlas tiles. The atlas width (in pixels). The atlas height (in pixels). The nodes padding (in pixels). Distance from node contents to atlas borders or other nodes.
| 114 | /// <param name="atlasHeight">The atlas height (in pixels).</param> |
| 115 | /// <param name="bordersPadding">The nodes padding (in pixels). Distance from node contents to atlas borders or other nodes.</param> |
| 116 | void Init(Size atlasWidth, Size atlasHeight, Size bordersPadding = 0) |
| 117 | { |
| 118 | Width = atlasWidth; |
| 119 | Height = atlasHeight; |
| 120 | BordersPadding = bordersPadding; |
| 121 | Nodes.Clear(); |
| 122 | FreeNodes.Clear(); |
| 123 | Nodes.Add(NodeType(bordersPadding, bordersPadding, atlasWidth - bordersPadding, atlasHeight - bordersPadding)); |
| 124 | FreeNodes.Add(&Nodes[0]); |
| 125 | } |
| 126 | |
| 127 | /// <summary> |
| 128 | /// Clears the atlas. This won't invoke OnFree for atlas tiles. |