linsyking/messenger-core/17.1.2

NOTE: the latest version is 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

There are many assets (images) in our game, so it's important to manage them.

In elm-canvas, we have to preload all the images before the game starts.

The game will only start when all resources are loaded.

If some asset is not found, the game will panic and throw an error (alert).

After the resources are loaded, we can get those data from globaldata.sprites.

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

Save the sprite.

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

Get the texture by name.

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

Definition for a resource.

type alias ResourceDefs =
List ( String, ResourceDef )

A list of resource definitions.

resourceNum : ResourceDefs -> Int

The number of sprites in the game.