Class PreviewsCache
Asset which contains set of asset items thumbnails (cached previews).
Inherited Members
Assembly: FlaxEngine.dll
File: Editor/Content/PreviewsCache.h
Syntax
public class PreviewsCache : public SpriteAtlas
Methods
Create(const StringView& outputPath)
Creates a new atlas.
Declaration
public static bool Create(const StringView& outputPath)
Parameters
StringView
outputPath
The output asset file path. |
Returns
bool
True if this previews cache is flushing, otherwise false. |
FindSlot(const Guid& id)
Finds the preview icon for given asset ID.
Declaration
public SpriteHandle FindSlot(const Guid& id)
Parameters
Guid
id
The asset id to find preview for it. |
Returns
SpriteHandle
The output sprite slot handle or invalid if invalid in nothing found. |
Flush()
Flushes atlas data from the GPU to the asset storage (saves data).
Declaration
public void Flush()
getChunksToPreload()
Gets packed chunks indices to preload before asset loading action
Declaration
protected virtual AssetChunksFlag getChunksToPreload() const override
Returns
AssetChunksFlag
Chunks to load flags |
Overrides
HasFreeSlot()
Determines whether this atlas has one or more free slots for the asset preview.
Declaration
public bool HasFreeSlot() const
Returns
bool
|
IsFlushing()
Determines whether this instance is flushing.
Declaration
public bool IsFlushing() const
Returns
bool
True if this previews cache is flushing, otherwise false. |
IsReady()
Determines whether this atlas is ready (is loaded and has texture streamed).
Declaration
public bool IsReady() const
Returns
bool
|
load()
Load data from the chunks
Declaration
protected virtual LoadResult load() override
Returns
LoadResult
Loading result |
Overrides
OccupySlot(GPUTexture* source, const Guid& id)
Occupies the atlas slot.
Declaration
public SpriteHandle OccupySlot(GPUTexture* source, const Guid& id)
Parameters
GPUTexture
source
The source texture to insert. |
Guid
id
The asset identifier. |
Returns
SpriteHandle
The added sprite slot handle or invalid if invalid in failed to occupy slot. |
ReleaseSlot(const Guid& id)
Releases the used slot.
Declaration
public bool ReleaseSlot(const Guid& id)
Parameters
Guid
id
The asset identifier. |
Returns
bool
True if slot has been release, otherwise it was not found. |
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. |