FTextureLayout

An incremental texture space allocator.

Windows
MacOS
Linux

Syntax

class FTextureLayout

Remarks

An incremental texture space allocator. For best results, add the elements ordered descending in size.

Constructors

Name Description

Public function

FTextureLayout

(
    uint32 MinSizeX,
    uint32 MinSizeY,
    uint32 MaxSizeX,
    uint32 MaxSizeY,
    bool bInPowerOfTwoSize,
    bool bInForce2To1Aspect,
    bool bInAlignByFour
)

Minimal initialization constructor.

Functions

Name Description

Public function

bool

 

AddElement

(
    uint32& OutBaseX,
    uint32& OutBaseY,
    uint32 ElementSizeX,
    uint32 ElementSizeY
)

Finds a free area in the texture large enough to contain a surface with the given size.

Public function Const

uint32

 

GetSizeX()

Returns the minimum texture width which will contain the allocated surfaces.

Public function Const

uint32

 

GetSizeY()

Returns the minimum texture height which will contain the allocated surfaces.

Public function

bool

 

RemoveElement

(
    uint32 ElementBaseX,
    uint32 ElementBaseY,
    uint32 ElementSizeX,
    uint32 ElementSizeY
)

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.

References

Module

Engine

Header

Runtime/Engine/Public/TextureLayout.h

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback