This class describe a rectangle that were added to the map.
You have access to its coordinates either in pixel or normalized (UV)
@returns the position of this node into the map
@returns the size of the rectangle this node handles
Compute the UV of the top/left, top/right, bottom/right, bottom/left points of the rectangle this node handles into the map
@returns And array of 4 Vector2, containing UV coordinates for the four corners of the Rectangle into the map
Retrieve the inner position (considering the margin) and stores it into the res object
|res||Vector2||must be a valid Vector2 that will contain the inner position after this call|
Retrieve the inner size (considering the margin) and stores it into the res object
|res||Size||must be a valid Size that will contain the inner size after this call|
You may have allocated the PackedRect using over-provisioning (you allocated more than you need in order to prevent frequent deallocations/reallocations)
and then using only a part of the PackRect.
This method will return the UVs for this part by given the custom size of what you really use
|customSize||Size||must be less/equal to the allocated size, UV will be compute from this must be less/equal to the allocated size, UV will be compute from this|
Free this rectangle from the map.
Call this method when you no longer need the rectangle to be in the map.