Show / Hide Table of Contents

    Interface ITextureCache

    A single cache which stores all of the textures in a single place.

    Namespace: AGS.API
    Assembly: AGS.API.dll
    Syntax
    public interface ITextureCache

    Methods

    | Improve this Doc View Source

    GetTexture(String, Func<String, ITexture>)

    Gets a texture (or creates a texture using the factory function if the texture doesn't exist).

    Declaration
    ITexture GetTexture(string id, Func<string, ITexture> factory)
    Parameters
    Type Name Description
    System.String id

    The texture id (path on the file system, for example).

    System.Func<System.String, ITexture> factory

    A function to create the texture if the texture does not exist already.

    Returns
    Type Description
    ITexture

    The texture.

    | Improve this Doc View Source

    RemoveTexture(String)

    Removes the texture from the cache.

    Declaration
    void RemoveTexture(string id)
    Parameters
    Type Name Description
    System.String id

    The texture id (path on the file system, for example).

    | Improve this Doc View Source

    TryGetTexture(String, out ITexture)

    Tries to get the texture.

    Declaration
    bool TryGetTexture(string id, out ITexture texture)
    Parameters
    Type Name Description
    System.String id

    The texture id (path on the file system, for example).

    ITexture texture

    The returned texture (or null if it doesn't exist).

    Returns
    Type Description
    System.Boolean

    true, if the texture exists, false otherwise.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX