Header menu logo Mibo

IAssets Type

Per-game asset loader/cache service for the MonoGame backend.

Provides cached loading for textures, fonts, sounds, models, effects, and 3D animation clips via the MonoGame content pipeline. Extends IAssetCache so portable code can cache custom assets without referencing a backend.

Example

 let assets = GameContext.getService<IAssets> ctx
 let tex = assets.Texture "sprites/player"
 let font = assets.Font "fonts/main"
 let clips = assets.ModelAnimations "assets/character.glb"
val assets: obj
val tex: obj
val font: obj
val clips: obj

Instance members

Instance member Description

this.AnimatedMesh

Full Usage: this.AnimatedMesh

Parameters:
    path : string

Returns: AnimatedMesh voption
Modifiers: abstract

Loads and caches skeleton data (bone names + inverse-bind matrices) from a raw model file via Assimp at runtime.

Used for GPU skinning via Draw3D.drawSkinnedMesh. Returns ValueNone if the model has no bones. Same path rules as IAssets.ModelAnimations.

path : string
Returns: AnimatedMesh voption

this.Effect

Full Usage: this.Effect

Parameters:
    path : string

Returns: Effect
Modifiers: abstract

Loads and caches an Effect from the content pipeline.

path : string
Returns: Effect

this.Font

Full Usage: this.Font

Parameters:
    path : string

Returns: SpriteFont
Modifiers: abstract

Loads and caches a SpriteFont from the content pipeline.

path : string
Returns: SpriteFont

this.Model

Full Usage: this.Model

Parameters:
    path : string

Returns: Model
Modifiers: abstract

Loads and caches a 3D Model from the content pipeline.

path : string
Returns: Model

this.ModelAnimations

Full Usage: this.ModelAnimations

Parameters:
    path : string

Returns: Animation3DClips
Modifiers: abstract

Loads and caches 3D animation clips from a raw model file (.glb/.gltf/.fbx/.dae/.blend/etc.) via Assimp at runtime.

The MonoGame content pipeline does not preserve animation data in XNB, so clips are loaded directly from the raw model file via AssimpNetter. The path is a filesystem path (relative to the ContentManager.RootDirectory or the working directory), NOT a content-pipeline XNB path. The caller MUST ensure the raw model file is copied to the output directory (e.g. <CopyToOutputDirectory> in the .fsproj). Returns an empty clip set if the file has no animations.

path : string
Returns: Animation3DClips

this.Sound

Full Usage: this.Sound

Parameters:
    path : string

Returns: SoundEffect
Modifiers: abstract

Loads and caches a SoundEffect from the content pipeline.

path : string
Returns: SoundEffect

this.Texture

Full Usage: this.Texture

Parameters:
    path : string

Returns: Texture2D
Modifiers: abstract

Loads and caches a Texture2D from the content pipeline.

path : string
Returns: Texture2D

Type something to start searching.