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.
Some Basic Data Types for the game
GlobalData
GlobalData is the user-facing global state.
It won't be reset if you change the scene.
It is mainly used for display and reading/writing some localstorage data.
Runtime values like time, input state, scene name, and volume live in the
separate read-only Runtime; use the getter functions below to read them.
userdata records the data that users set to saveextraHTML is used to render extra HTML tags. Be careful to use thiscanvasAttributes is used to attach attributes to the game canvascamera records the camera position and zoom levelOpaque internal engine data.
Environment
Environment is provided to users almost all the time.
It stores GlobalData and CommonData (Similar to GlobalData but just for one scene), so you can get and modify them through the Env.
Remove common data from environment.
Useful when dealing with portable components by yourself.
Most of the time it will not be used since it has been built into prepared update functions.
Add the common data to a Environment without common data.
This type is for user to use when initializing the messenger. It is very useful when dealing with local storage.
Safe access to internal engine state
Get elapsed time since the current scene started.
Get elapsed time since the game started.
Get the frame count since the game started.
Get the frame count since the current scene started.
Get the current timestamp.
Get the current browser visibility.
Get the mouse position in virtual coordinates.
Get the pressed mouse buttons.
Get the pressed keys.
Get the current volume.
Get the current scene name.
Get virtual coordinate dimensions
Get real canvas dimensions
Get browser viewport dimensions
Get canvas positioning offset
Get resource loading progress (loaded, total)
Get set of loaded font names
Get set of loaded shader program names
Get a specific sprite texture by name
Get all loaded sprite textures
Get loaded config data by key.
User Event
This is the User Event for the game.
Users can get outside information through these events.
Tickis triggered every timeInterval. The int attacked to it isKeyDown,KeyUprecords the keyboard events. "KeyDown" event is sent when the key is pressed, "KeyUp" is sent when the key is released.getPressedKeys runtimeinstead. check all the keycodes here.MouseDown,MouseUprecords the button code and position when mouse up and down. Mouse code 0 represents the left mouse button, 1 represents middle mouse button and 2 represents right mouse button.We have provide some key and mouse codes in messenger-extra.
MouseWheelrecords the wheel event for mouse, positive value means scrolling down while negative value means scrolling up. It can be also used for touchpad.Prompt name resultgives the result user entered in the prompt window.