![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <TextureLayout.h>
Public Member Functions | |
| FTextureLayout (uint32 InMinSizeX, uint32 InMinSizeY, uint32 MaxSizeX, uint32 MaxSizeY, bool bInPowerOfTwoSize=false, ETextureLayoutAspectRatio InAspect=ETextureLayoutAspectRatio::None, bool bInAlignByFour=true) | |
| bool | AddElement (uint32 &OutBaseX, uint32 &OutBaseY, uint32 ElementSizeX, uint32 ElementSizeY) |
| bool | RemoveElement (uint32 ElementBaseX, uint32 ElementBaseY, uint32 ElementSizeX, uint32 ElementSizeY) |
| uint32 | GetSizeX () const |
| uint32 | GetSizeY () const |
An incremental texture space allocator. For best results, add the elements ordered descending in size.
|
inline |
Minimal initialization constructor.
| MinSizeX | - The minimum width of the texture. |
| MinSizeY | - The minimum height of the texture. |
| MaxSizeX | - The maximum width of the texture. |
| MaxSizeY | - The maximum height of the texture. |
| InPowerOfTwoSize | - True if the texture size must be a power of two. |
| bInForce2To1Aspect | - True if the texture size must have a 2:1 aspect. |
| bInAlignByFour | - True if the texture size must be a multiple of 4.. |
|
inline |
Finds a free area in the texture large enough to contain a surface with the given size. If a large enough area is found, it is marked as in use, the output parameters OutBaseX and OutBaseY are set to the coordinates of the upper left corner of the free area and the function return true. Otherwise, the function returns false and OutBaseX and OutBaseY remain uninitialized.
| OutBaseX | - If the function succeeds, contains the X coordinate of the upper left corner of the free area on return. |
| OutBaseY | - If the function succeeds, contains the Y coordinate of the upper left corner of the free area on return. |
| ElementSizeX | - The size of the surface to allocate in horizontal pixels. |
| ElementSizeY | - The size of the surface to allocate in vertical pixels. |
|
inline |
Returns the minimum texture width which will contain the allocated surfaces.
|
inline |
Returns the minimum texture height which will contain the allocated surfaces.
|
inline |
Removes a previously allocated element from the layout and collapses the tree as much as possible, In order to create the largest free block possible and return the tree to its state before the element was added.