linsyking/messenger-core/20.0.0

Renamed to elm-messenger/messenger-core. That is where the repository lives now. It has not been published as a package under the new name.

Versions published as linsyking/messenger-core still install under that name. 34 versions of 52 come from the new location (see their notes). 7 versions could not be recovered and cannot be installed.

Messenger.Resources.Base

Resource

Resource definitions used by Messenger's loader.

Resources are declared as ( name, ResourceDef ) pairs. Messenger loads initial resources before normal updates begin, and dynamic resources can be loaded later with SOMLoadResource.

Loaded data is stored in opaque internal engine state. User code should use getters from Messenger.Base such as getLoadingProgress, getSprite, getFonts, getPrograms, and getConfigData.

saveSprite : Dict String Texture -> String -> Texture -> Dict String Texture

Save a loaded texture into the texture dictionary.

This is used internally by the loader. User code usually reads textures through Messenger.Base.getSprite or renders by name with Messenger.Render.Texture.

igetSprite : String -> Dict String Texture -> Maybe Texture

Get a texture by name from a texture dictionary.

This is a low-level helper used by texture rendering internals.

= TextureRes String (Maybe TextureOptions)
| AudioRes String
| FontRes String String
| ProgramRes REGLProgram
| DataRes String

Definition for a loadable resource.

  • TextureRes url options loads an image texture.
  • AudioRes url loads an audio source.
  • FontRes textureUrl jsonUrl loads an MSDF font.
  • ProgramRes program creates a custom REGL program.
  • DataRes path loads a plain text data file.
type alias ResourceDefs =
List ( String, ResourceDef )

A list of named resource definitions.

resourceNum : ResourceDefs -> Int

Count resource definitions.

Messenger uses this to track loading progress.