Skip to main content
Version: 1.0.0-preview.33

Velaptor.ExtensionMethods.ContentExtensions

Velaptor

Velaptor.ExtensionMethods

ContentExtensions Class

Provides content related extension methods.

public static class ContentExtensions

Inheritance System.Object → ContentExtensions

Methods

Load(this ILoader<IFont>, string, uint)

Loads font content from the application's content directory or directly using a full file path.

public static Velaptor.Content.Fonts.IFont Load(this Velaptor.Content.ILoader<Velaptor.Content.Fonts.IFont> loader, string fontName, uint size);

Parameters

loader Velaptor.Content.ILoader<IFont>

The font loader.

fontName System.String

The name or full file path to the font with metadata.

size System.UInt32

The size of the font.

Returns

IFont
The loaded font.

Exceptions

System.ArgumentNullException
Occurs when the fontName argument is null or empty.

System.IO.FileNotFoundException
Occurs if the font file does not exist.

Remarks

If a path is used, it must be a fully qualified file path.

Directory paths are not valid.

Unload(this ILoader<IFont>, IFont)

Unloads the given font.

public static void Unload(this Velaptor.Content.ILoader<Velaptor.Content.Fonts.IFont> loader, Velaptor.Content.Fonts.IFont? font);

Parameters

loader Velaptor.Content.ILoader<IFont>

The loader.

font IFont

The content to unload.

Unload(this ILoader<IAtlasData>, IAtlasData)

Unloads the given atlas.

public static void Unload(this Velaptor.Content.ILoader<Velaptor.Content.IAtlasData> loader, Velaptor.Content.IAtlasData? atlas);

Parameters

loader Velaptor.Content.ILoader<IAtlasData>

The loader.

atlas IAtlasData

The content to unload.

Unload(this ILoader<ISound>, ISound)

Unloads the given sound.

public static void Unload(this Velaptor.Content.ILoader<Velaptor.Content.ISound> loader, Velaptor.Content.ISound? sound);

Parameters

loader Velaptor.Content.ILoader<ISound>

The loader.

sound ISound

The content to unload.

Unload(this ILoader<ITexture>, ITexture)

Unloads the given texture.

public static void Unload(this Velaptor.Content.ILoader<Velaptor.Content.ITexture> loader, Velaptor.Content.ITexture? texture);

Parameters

loader Velaptor.Content.ILoader<ITexture>

The loader.

texture ITexture

The content to unload.