Class FontTextureAtlas
Texture resource that contains an atlas of cached font glyphs.
Inheritance
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Render2D/FontTextureAtlas.h
Syntax
public class FontTextureAtlas : public Texture
Constructors
FontTextureAtlas(PixelFormat format, PaddingStyle paddingStyle, int32 index)
Initializes a new instance of the FontTextureAtlas class.
Declaration
public FontTextureAtlas(PixelFormat format, PaddingStyle paddingStyle, int32 index)
Parameters
|
PixelFormat
format
The texture pixels format. |
|
PaddingStyle
paddingStyle
The texture entries padding style. |
|
int32
index
The atlas index. |
Methods
AddEntry(uint32 width, uint32 height, const Array<byte>& data)
Adds the new entry to the atlas
Declaration
public FontTextureAtlasSlot* AddEntry(uint32 width, uint32 height, const Array<byte>& data)
Parameters
|
uint32
width
Width of the entry. |
|
uint32
height
Height of the entry. |
|
Array<byte>
data
The data. |
Returns
|
FontTextureAtlasSlot
The atlas slot occupied by the new entry. |
Clear()
Clears this atlas entries data (doesn't change size/texture etc.).
Declaration
public void Clear()
CopyDataIntoSlot(const FontTextureAtlasSlot* slot, const Array<byte>& data)
Copies the data into the slot.
Declaration
public void CopyDataIntoSlot(const FontTextureAtlasSlot* slot, const Array<byte>& data)
Parameters
|
FontTextureAtlasSlot
slot
The slot. |
|
Array<byte>
data
The data. |
EnsureTextureCreated()
Ensures that texture has been created for that atlas.
Declaration
public void EnsureTextureCreated() const
Flush()
Flushes this atlas data to the GPU
Declaration
public void Flush()
GetHeight()
Gets the atlas height.
Declaration
public uint32 GetHeight() const
Returns
|
uint32
|
GetPaddingAmount()
Gets amount of pixels to pad textures inside an atlas.
Declaration
public uint32 GetPaddingAmount() const
Returns
|
uint32
|
GetPaddingStyle()
Gets padding style for textures in the atlas.
Declaration
public PaddingStyle GetPaddingStyle() const
Returns
|
PaddingStyle
|
GetSize()
Gets the atlas size.
Declaration
public Float2 GetSize() const
Returns
|
Float2
|
GetSlotData(const FontTextureAtlasSlot* slot, uint32& width, uint32& height, uint32& stride)
Returns glyph's bitmap data of the slot.
Declaration
public byte* GetSlotData(const FontTextureAtlasSlot* slot, uint32& width, uint32& height, uint32& stride)
Parameters
|
FontTextureAtlasSlot
slot
The slot in atlas. |
|
uint32
width
The width of the slot. |
|
uint32
height
The height of the slot. |
|
uint32
stride
The stride of the slot. |
Returns
|
byte
The pointer to the bitmap data of the given slot. |
GetWidth()
Gets the atlas width.
Declaration
public uint32 GetWidth() const
Returns
|
uint32
|
HasDataSyncWithGPU()
Determines whether atlas has data synchronized with the GPU.
Declaration
public bool HasDataSyncWithGPU() const
Returns
|
bool
|
Init(uint32 width, uint32 height)
Initializes the atlas.
Declaration
public void Init(uint32 width, uint32 height)
Parameters
|
uint32
width
The width. |
|
uint32
height
The height. |
Invalidate(const FontTextureAtlasSlot* slot)
Invalidates the cached dynamic entry from the atlas.
Declaration
public bool Invalidate(const FontTextureAtlasSlot* slot)
Parameters
|
FontTextureAtlasSlot
slot
The slot to invalidate. |
Returns
|
bool
True if slot has been freed, otherwise false. |
Invalidate(uint32 x, uint32 y, uint32 width, uint32 height)
Invalidates the cached dynamic entry from the atlas.
Declaration
public bool Invalidate(uint32 x, uint32 y, uint32 width, uint32 height)
Parameters
|
uint32
x
The slot location (X coordinate in atlas pixels). |
|
uint32
y
The slot location (Y coordinate in atlas pixels). |
|
uint32
width
The slot width (size in atlas pixels). |
|
uint32
height
The slot height (size in atlas pixels). |
Returns
|
bool
True if slot has been freed, otherwise false. |
IsDirty()
Determines whether this atlas is dirty and data need to be flushed.
Declaration
public bool IsDirty() const
Returns
|
bool
|
Setup(PixelFormat format, PaddingStyle paddingStyle)
Setups the atlas after creation.
Declaration
public void Setup(PixelFormat format, PaddingStyle paddingStyle)
Parameters
|
PixelFormat
format
The pixel format. |
|
PaddingStyle
paddingStyle
The padding style. |
unload(bool isReloading)
Unloads asset data
Declaration
protected virtual void unload(bool isReloading) override
Parameters
|
bool
isReloading
True if asset is reloading data, otherwise false. |