ResourceLibraryclass

Keeps a library of all available `Sandbox.Resource`.

objectResourceLibrary
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public static abstract sealed class Sandbox.ResourceLibrary

Methods7

Showing 7 methods

public static System.Threading.Tasks.Task`1<Sandbox.Bitmap> GetThumbnail(string path, int width = 256, int height = 256)PUBLICSTATIC

Render a thumbnail for this resource

ParameterTypeDescription
pathstring
width = 256int
height = 256int
Returns:Task<Bitmap>

public static System.Threading.Tasks.Task`1<T> LoadAsync(string path)PUBLICSTATIC

Load a resource by its file path.

ParameterTypeDescription
pathstring
Returns:Task<T>

public static bool TryGet(string filepath, T resource)PUBLICSTATIC

Try to get a cached resource by its file path.

ParameterTypeDescription
filepathstringFile path to the resource.
resourceTThe retrieved resource, if any.
Returns:boolTrue if resource was retrieved successfully.

On this page