rapid-render
    Preparing search index...

    Class TextureManager

    Manages texture loading, caching, and creation.

    Index

    Constructors

    Methods

    • Creates a generic Render Texture (FrameBuffer).

      Parameters

      • width: number

        The width of the render texture.

      • height: number

        The height of the render texture.

      • Optionaloptions: ITextureOptions

        Optional configuration for the texture.

      Returns RenderTexture

      The newly created RenderTexture.

    • Destroys a texture and potentially removes its BaseTexture from the cache. If a Texture instance is provided, it decrements the reference count of the BaseTexture. The BaseTexture will only be destroyed if its reference count drops to 0, or if force is true.

      Parameters

      • textureOrUrl: string | Texture | BaseTexture

        The texture instance, base texture, or cache key (URL) to destroy.

      • force: boolean = false

        If true, destroys the underlying BaseTexture immediately regardless of reference count.

      Returns void

    • Destroys all cached textures and clears the cache, ignoring reference counts.

      Returns void

    • Asynchronously loads a texture from a URL.

      Parameters

      • url: string

        The image URL to load.

      • Optionaloptions: ITextureOptions

        Optional configuration for the texture.

      Returns Promise<Texture>

      A promise that resolves to the loaded Texture.