FTextureLayout::AddElement

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

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/TextureLayout.h

Include

#include "TextureLayout.h"

Syntax

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

Remarks

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.

Returns

True if succeeded, false otherwise.

Parameters

Parameter

Description

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.

Select Skin
Light
Dark

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