Class Assets
- Namespace
- Elegy.AssetSystem.API
- Assembly
- Elegy.AssetSystem.dll
Asset system.
public static class Assets
- Inheritance
-
Assets
- Inherited Members
Properties
AllLevels
A collection of all loaded levels.
public static IReadOnlyCollection<ElegyMapDocument> AllLevels { get; }
Property Value
AllMaterials
All the materials in the system.
public static IEnumerable<Material> AllMaterials { get; }
Property Value
AllModels
A collection of all loaded models.
public static IReadOnlyCollection<Model> AllModels { get; }
Property Value
MissingTexture
The "missing texture" texture.
public static Texture MissingTexture { get; }
Property Value
Methods
FindLevelLoader(params string[])
Finds an appropriate ILevelLoader according to one of the extensions.
public static ILevelLoader? FindLevelLoader(params string[] extensions)
Parameters
extensionsstring[]
Returns
FindLevelWriter(string)
Finds an appropriate ILevelWriter according to the extension.
public static ILevelWriter? FindLevelWriter(string extension)
Parameters
extensionstring
Returns
FindModelLoader(params string[])
Finds an appropriate IModelLoader according to one of the extensions.
public static IModelLoader? FindModelLoader(params string[] extensions)
Parameters
extensionsstring[]
Returns
FindTextureLoader(params string[])
Finds an appropriate ITextureLoader according to one of the extensions.
public static ITextureLoader? FindTextureLoader(params string[] extensions)
Parameters
extensionsstring[]
Returns
GetTextureMetadata(string)
Loads and returns a TextureMetadata. This result is not cached, unlike LoadTexture(string, bool).
public static TextureMetadata? GetTextureMetadata(string texturePath)
Parameters
texturePathstring
Returns
Init(in LaunchConfig)
public static bool Init(in LaunchConfig config)
Parameters
configLaunchConfig
Returns
LoadLevel(string)
Loads a level from the path.
public static ElegyMapDocument? LoadLevel(string path)
Parameters
pathstring
Returns
LoadMaterial(string)
Loads a material from the material library.
public static Material? LoadMaterial(string materialName)
Parameters
materialNamestringName of the material.
Returns
LoadModel(string)
Loads a model from the path.
public static Model? LoadModel(string path)
Parameters
pathstring
Returns
LoadTexture(string, bool)
Loads and returns a Texture. Caches the result so it can be easily retrieved if the same texture is referenced by multiple materials.
public static Texture? LoadTexture(string texturePath, bool hintSrgb = false)
Parameters
Returns
PostInit()
public static bool PostInit()
Returns
SetRenderFactories(Func<MaterialDefinition, IMaterial?>, Func<TextureMetadata, byte[], ITexture?>)
public static void SetRenderFactories(Func<MaterialDefinition, IMaterial?> materialFactory, Func<TextureMetadata, byte[], ITexture?> textureFactory)
Parameters
materialFactoryFunc<MaterialDefinition, IMaterial>textureFactoryFunc<TextureMetadata, byte[], ITexture>
Shutdown()
public static void Shutdown()
UnloadMaterial(ref Material?)
Unloads the material. It is a reference, so it will
become null after this.
public static bool UnloadMaterial(ref Material? material)
Parameters
materialMaterial
Returns
WriteLevel(string, ElegyMapDocument)
Writes a level to the given path.
public static bool WriteLevel(string path, ElegyMapDocument data)
Parameters
pathstringdataElegyMapDocument