MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Init

Method Init

Source/Engine/Utilities/RectPack.h:116–125  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 2

ClearMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected