Assets Module
Friendly GameContext-based accessors for the built-in IAssets service.
These functions assume Program.withAssets has been applied.
Functions and values
| Function or value |
Description
|
Full Usage:
create key factory ctx
Parameters:
string
factory : GraphicsDevice -> 'T
ctx : GameContext
Returns: 'T
|
|
|
|
|
|
Full Usage:
fromCustom path loader _ctx
Parameters:
string
loader : string -> 'T
_ctx : GameContext
Returns: 'T
|
Load an asset using a custom loader function. The loader receives the file path and should return the loaded asset.
|
Full Usage:
fromCustomCache path loader ctx
Parameters:
string
loader : string -> 'T
ctx : GameContext
Returns: 'T
|
Load an asset using a custom loader with caching (game-lifetime).
|
Full Usage:
fromJson path decoder
Parameters:
string
decoder : Decoder<'T>
Returns: 'T
|
Load a JSON file and decode it using the provided JDeck decoder. Reads from the Content directory (uses TitleContainer).
|
Full Usage:
fromJsonCache path decoder ctx
Parameters:
string
decoder : Decoder<'T>
ctx : GameContext
Returns: 'T
|
Load a JSON file with caching (game-lifetime). On first call, decodes and caches; subsequent calls return cached value.
|
|
|
Full Usage:
getOrCreate key factory ctx
Parameters:
string
factory : GraphicsDevice -> 'T
ctx : GameContext
Returns: 'T
|
|
|
|
|
|
|
|
|
|
|
|
Mibo