Search Results for

    Show / Hide Table of Contents

    Class Texture

    Texture asset contains an image that is usually stored on a GPU and is used during rendering graphics.

    Inheritance
    Object
    ScriptingObject
    ManagedScriptingObject
    Asset
    BinaryAsset
    TextureBase
    Texture
    Inherited Members
    TextureBase::_customData
    Asset::_deleteFileOnUnload
    BinaryAsset::_dependantAssets
    ScriptingObject::_gcHandle
    BinaryAsset::_header
    ScriptingObject::_id
    BinaryAsset::_isSaving
    Asset::_isVirtual
    Asset::_loadingTask
    Asset::_loadState
    TextureBase::_parent
    Asset::_refCount
    BinaryAsset::_storageRef
    TextureBase::_texture
    ScriptingObject::_type
    BinaryAsset::AddDependency(BinaryAsset* asset)
    Asset::AddReference()
    Asset::Asset(const SpawnParams& params, const AssetInfo* info)
    TextureBase::CalculateChunkIndex(int32 mipIndex)
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    TextureBase::CancelStreaming()
    ScriptingObject::Cast(ScriptingObject* obj)
    Asset::ChangeID(const Guid& newId)
    BinaryAsset::ClearDependencies()
    Asset::const
    BinaryAsset::createLoadingTask()
    Asset::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    Asset::DECLARE_ENUM_7(LoadResult, Ok, Failed, MissingDataChunk, CannotLoadData, CannotLoadStorage, CannotLoadInitData, InvalidData)
    ScriptingObject::Deleted
    Asset::DeleteManaged()
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    BinaryAsset::Dependencies
    Asset::DEPRECATED("Use GetReferences with assets and files parameter instead")
    Asset::DestroyManaged()
    Texture
    Object::Flags
    TextureBase::Format()
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    TextureBase::GetArraySize()
    BinaryAsset::GetChunk(int32 index)
    BinaryAsset::GetChunkData(int32 index, BytesContainer& data)
    BinaryAsset::GetChunkSize(int32 index)
    BinaryAsset::getChunksToPreload()
    ScriptingObject::GetClass()
    TextureBase::GetCurrentMemoryUsage()
    ScriptingObject::GetID()
    BinaryAsset::GetImportMetadata(String& path, String& username)
    BinaryAsset::GetImportPath()
    ScriptingObject::GetManagedInstance()
    TextureBase::GetMemoryUsage()
    TextureBase::GetMipData(int32 mipIndex, int32& rowPitch, int32& slicePitch)
    TextureBase::GetMipData(int32 mipIndex, BytesContainer& data)
    TextureBase::GetMipDataCustomPitch(int32 mipIndex, uint32& rowPitch, uint32& slicePitch)
    TextureBase::GetMipDataWithLoading(int32 mipIndex, BytesContainer& data)
    TextureBase::GetMipLevels()
    BinaryAsset::GetOrCreateChunk(int32 index)
    ScriptingObject::GetOrCreateManagedInstance()
    TextureBase::GetOwnerLocker()
    BinaryAsset::GetPath()
    TextureBase::GetPixels(Array<Color32>& pixels, int32 mipIndex = 0, int32 arrayIndex = 0)
    TextureBase::GetPixels(Array<Color>& pixels, int32 mipIndex = 0, int32 arrayIndex = 0)
    Asset::GetReferences(Array<Guid, HeapAllocation>& assets, Array<String, HeapAllocation>& files)
    Asset::GetReferences()
    Asset::GetReferencesCount()
    TextureBase::GetResidentMipLevels()
    BinaryAsset::GetSerializedVersion()
    TextureBase::GetTexture()
    TextureBase::GetTextureData(TextureData& result, bool copyData=true)
    TextureBase::GetTextureGroup()
    TextureBase::GetTextureMipData(TextureMipData& result, int32 mipIndex = 0, int32 arrayIndex = 0, bool copyData=true)
    TextureBase::GetTotalMemoryUsage()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    Asset::GetTypeName()
    BinaryAsset::HasChunk(int32 index)
    BinaryAsset::HasChunkLoaded(int32 index)
    BinaryAsset::HasDependenciesModified()
    ScriptingObject::HasManagedInstance()
    TextureBase::HasStreamingError()
    TextureBase::Height()
    TextureBase::init(AssetInitData& initData)
    TextureBase::Init(InitData* initData)
    TextureBase::Init(InitData&& initData)
    BinaryAsset::Init(const FlaxStorageReference& storage, AssetHeader& header)
    BinaryAsset::Init(AssetInitData& initData)
    Asset::InitAsVirtual()
    BinaryAsset::InitVirtual(AssetInitData& initData)
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    Asset::IsInternalType()
    Asset::IsLoaded()
    ScriptingObject::IsRegistered()
    Asset::IsVirtual()
    Asset::LastLoadFailed()
    TextureBase::load()
    BinaryAsset::loadAsset()
    BinaryAsset::LoadChunk(int32 chunkIndex)
    BinaryAsset::LoadChunks(AssetChunksFlag chunks)
    Texture
    TextureBase::LockData()
    Asset::Locker
    ManagedScriptingObject::ManagedScriptingObject(const SpawnParams& params)
    BinaryAsset::Metadata
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    Asset::OnCheckSave(const StringView& path=StringView::Empty)
    BinaryAsset::OnDeleteObject()
    BinaryAsset::OnDependencyModified(BinaryAsset* asset)
    Asset::onLoad(LoadAssetTask* task)
    Asset::OnLoaded
    Asset::onLoaded()
    Asset::onLoaded_MainThread()
    Asset::OnManagedInstanceDeleted()
    Asset::OnReloading
    BinaryAsset::onRename(const StringView& newPath)
    Asset::OnScriptingDispose()
    Asset::onUnload_MainThread()
    Asset::OnUnloaded
    ScriptingObject::RegisterObject()
    BinaryAsset::Reimport()
    BinaryAsset::ReleaseChunk(int32 index)
    BinaryAsset::ReleaseChunks()
    BinaryAsset::releaseStorage()
    Asset::Reload()
    Asset::RemoveReference()
    BinaryAsset::RequestChunkDataAsync(int32 index)
    TextureBase::RequestMipDataAsync(int32 mipIndex)
    BinaryAsset::SaveAsset(AssetInitData& data, bool silentMode=false)
    BinaryAsset::SaveAsset(const StringView& path, AssetInitData& data, bool silentMode=false)
    BinaryAsset::SaveToAsset(const StringView& path, AssetInitData& data, bool silentMode=false)
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    BinaryAsset::SetChunk(int32 index, const Span<byte>& data)
    ManagedScriptingObject::SetManagedInstance(MObject* instance)
    TextureBase::SetPixels(const Span<Color32>& pixels, int32 mipIndex = 0, int32 arrayIndex = 0, bool generateMips=false)
    TextureBase::SetPixels(const Span<Color>& pixels, int32 mipIndex = 0, int32 arrayIndex = 0, bool generateMips=false)
    TextureBase::SetTextureGroup(int32 textureGroup)
    Asset::ShouldDeleteFileOnUnload()
    TextureBase::Size()
    Texture
    Asset::startLoading()
    BinaryAsset::Storage
    TextureBase::StreamingTexture()
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    Asset::ToString()
    TextureBase::unload(bool isReloading)
    ScriptingObject::UnregisterObject()
    Asset::WaitForLoaded(double timeoutInMilliseconds=30000.0)
    TextureBase::Width()
    BinaryAsset::~BinaryAsset()
    Object::~Object()
    ScriptingObject::~ScriptingObject()
    Assembly: FlaxEngine.dll
    File: Engine/Content/Assets/Texture.h
    Syntax
    public class Texture : public TextureBase

    Methods

    FromFile(const StringView& path, bool generateMips=false)

    Loads the texture from the image file and creates the virtual texture asset for it. Supported file formats depend on a runtime platform. All platform support loading PNG, BMP, TGA, HDR and JPEG files.

    Declaration
    public static Texture* FromFile(const StringView& path, bool generateMips=false)
    Parameters
    StringView path

    The source image file path.

    bool generateMips

    True if generate mipmaps for the imported texture.

    Returns
    Texture

    The loaded texture (virtual asset) or null if fails.

    LoadFile(const StringView& path, bool generateMips=false)

    Loads the texture from the image file. Supported file formats depend on a runtime platform. All platform support loading PNG, BMP, TGA, HDR and JPEG files.

    Valid only for virtual assets.

    Declaration
    public bool LoadFile(const StringView& path, bool generateMips=false)
    Parameters
    StringView path

    The source image file path.

    bool generateMips

    True if generate mipmaps for the imported texture.

    Returns
    bool

    True if fails, otherwise false.

    Save(const StringView& path, const InitData* customData)

    Saves this asset to the file. Supported only in Editor.

    Declaration
    public bool Save(const StringView& path, const InitData* customData)
    Parameters
    StringView path

    The custom asset path to use for the saving. Use empty value to save this asset to its own storage location. Can be used to duplicate asset. Must be specified when saving virtual asset.

    InitData customData

    The custom texture data container. Can be used to override the data stored in the asset. Use null to ignore this argument.

    Returns
    bool

    True if cannot save data, otherwise false.

    Save(const StringView& path=StringView::Empty)

    Saves this asset to the file. Supported only in Editor.

    Declaration
    public virtual bool Save(const StringView& path=StringView::Empty) override
    Parameters
    StringView path

    The custom asset path to use for the saving. Use empty value to save this asset to its own storage location. Can be used to duplicate asset. Must be specified when saving virtual asset.

    Returns
    bool

    True when cannot save data, otherwise false.

    Overrides
    Asset::Save(const StringView& path=StringView::Empty)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat