[{"name":"Messenger.Audio.Audio","comment":"\n\n\n# Audio Module\n\nYou can play audio by emitting `SOMPlayAudio` message with the audio ID, a channel, and an option.\n\nThe channel is an integer that is used to identify the audio channel.\n\nYou **can** play different audio on the same channel at the same time. The previous audio will not be stopped.\n\nHowever, when you stop the channel, all audio on the channel will be stopped.\n\nIf an audio is finished playing, it will be removed from the playing channel.\n\n@docs newAudioChannel\n@docs audioDuration\n\n","unions":[],"aliases":[],"values":[{"name":"audioDuration","comment":" Get the duration of an audio by its ID.\n\nUsage : audioDuration runtime audioId\n\n  - runtime is the read-only Messenger runtime passed to user model functions.\n  - audioID is the NAME (not ID!) of the desired audio, which should be registered in the resources.elm.\n\nThe output of the function is a Maybe Duration, with which you can extract the Float value of the length in seconds via Duration.inSeconds.\n\nExample: audioDuration runtime \"Boom\" |> Duration.inSeconds == 1.274 -- the duration in seconds.\n\n","type":"Messenger.Base.Runtime -> String.String -> Maybe.Maybe Duration.Duration"},{"name":"newAudioChannel","comment":" Generate a new unique audio channel number.\n\n    Pass the read-only Messenger runtime as the parameter. The returned value is a generated channel number.\n        - Note: It is really similar to GenUID.\n\n","type":"Messenger.Base.Runtime -> Basics.Int"}],"binops":[]},{"name":"Messenger.Audio.Base","comment":"\n\n\n# Audio Base\n\n@docs AudioOption, AudioTarget, AudioCommonOption\n\n","unions":[{"name":"AudioOption","comment":" You can play one audio once or loop it.\n\n  - ALoop means the audio will be played repeatedly until a SOMStopAudio is called.\n  - AOnce means the audio will be played only once.\n\n","args":[],"cases":[["ALoop",["Maybe.Maybe Messenger.Audio.Base.AudioCommonOption","Maybe.Maybe Audio.LoopConfig"]],["AOnce",["Maybe.Maybe Messenger.Audio.Base.AudioCommonOption"]]]},{"name":"AudioTarget","comment":" The type used to specify the target of the AudioOptions, for example in SOMStopAudio.\n\n  - AllAudio sets the target to be all of the audios.\n  - AudioChannel sets the target to be a specific channel, which is determined by the Int following it.\n  - AudioName sets the target to be a specific audio piece by stating the Channel(Int) and the name(String) of the audio piece.\n\n","args":[],"cases":[["AllAudio",[]],["AudioChannel",["Basics.Int"]],["AudioName",["Basics.Int","String.String"]]]}],"aliases":[{"name":"AudioCommonOption","comment":" Audio common options.\n\n  - rate refers to the playing speed of the audio. For example, setting rate to 2 will make Messenger play the music at 2x Speed.\n  - start is the starting point where messenger starts to play music. It is a Duration value, and can be transferred from float by Duration.seconds\n\nExample: AudioCommonOption 1.5 <| Duration.seconds 30 -- The audio will be played at 1.5x speed and start from 30.0s.\n\n","args":[],"type":"{ rate : Basics.Float, start : Duration.Duration }"}],"values":[],"binops":[]},{"name":"Messenger.Base","comment":"\n\n\n# Base Module\n\nSome Basic Data Types for the game\n\n@docs UserEvent\n@docs GlobalData\n@docs Runtime\n@docs Env\n@docs Flags\n@docs removeCommonData, addCommonData\n@docs GlobalDataInit\n\n\n## Internal Data Getters\n\nSafe access to internal engine state\n\n@docs getSceneStartTime, getGlobalStartTime, getGlobalStartFrame, getSceneStartFrame\n@docs getCurrentTimeStamp, getWindowVisibility, getMousePos\n@docs getPressedMouseButtons, getPressedKeys, getVolume, getCurrentScene\n@docs getVirtualSize, getRealSize, getViewPort, getCanvasOffset\n@docs getLoadingProgress, getFonts, getPrograms, getSprite, getAllSprites, getConfigData\n\n","unions":[{"name":"UserEvent","comment":" User Event\n\nThis is the User Event for the game.\n\nUsers can get outside information through these events.\n\n`Tick` is triggered every timeInterval. The int attacked to it is\n\n`KeyDown`, `KeyUp` records the keyboard events.\n\"KeyDown\" event is sent when the key is pressed, \"KeyUp\" is sent when the key is released.\n\n  - Note: if you just want to check if a key is pressed or not, use `getPressedKeys runtime` instead.\n    check all the keycodes [here](https://www.toptal.com/developers/keycode).\n\n`MouseDown`, `MouseUp` records the button code and position when mouse up and down.\nMouse code 0 represents the left mouse button, 1 represents middle mouse button and 2 represents\nright mouse button.\n\nWe have provide some key and mouse codes in messenger-extra.\n\n`MouseWheel` records the wheel event for mouse, positive value means scrolling down while\nnegative value means scrolling up. It can be also used for touchpad.\n\n`Prompt name result` gives the result user entered in the prompt window.\n\n","args":[],"cases":[["Tick",["Basics.Float"]],["KeyDown",["Basics.Int"]],["KeyUp",["Basics.Int"]],["MouseDown",["Basics.Int","( Basics.Float, Basics.Float )"]],["MouseUp",["Basics.Int","( Basics.Float, Basics.Float )"]],["MouseWheel",["Basics.Int"]],["Prompt",["String.String","String.String"]]]}],"aliases":[{"name":"Env","comment":" Environment\n\nEnvironment is provided to users almost all the time.\n\nIt stores GlobalData and CommonData (Similar to GlobalData but just for one scene),\nso you can get and modify them through the Env.\n\n","args":["common","userdata"],"type":"{ globalData : Messenger.Base.GlobalData userdata, commonData : common }"},{"name":"Flags","comment":" The main flags.\n\nGet info from js script.\n\n**Learn more about flags [here](https://guide.elm-lang.org/interop/flags)**\n\n","args":[],"type":"{ timeStamp : Basics.Float, info : String.String }"},{"name":"GlobalData","comment":" GlobalData\n\nGlobalData is the user-facing global state.\n\nIt won't be reset if you change the scene.\n\nIt is mainly used for display and reading/writing some localstorage data.\nRuntime values like time, input state, scene name, and volume live in the\nseparate read-only `Runtime`; use the getter functions below to read them.\n\n  - `userdata` records the data that users set to save\n  - `extraHTML` is used to render extra HTML tags. Be careful to use this\n  - `canvasAttributes` is used to attach attributes to the game canvas\n  - `camera` records the camera position and zoom level\n\n","args":["userdata"],"type":"{ extraHTML : Maybe.Maybe (Html.Html Messenger.Internal.WorldEvent), canvasAttributes : List.List (Html.Attribute Messenger.Internal.WorldEvent), userData : userdata, camera : REGL.Common.Camera }"},{"name":"GlobalDataInit","comment":" This type is for user to use when initializing the messenger.\nIt is very useful when dealing with local storage.\n","args":["userdata"],"type":"{ camera : REGL.Common.Camera, volume : Basics.Float, extraHTML : Maybe.Maybe (Html.Html Messenger.Internal.WorldEvent), canvasAttributes : List.List (Html.Attribute Messenger.Internal.WorldEvent), userData : userdata }"},{"name":"Runtime","comment":" Opaque internal engine data.\n","args":[],"type":"Messenger.Internal.InternalData"}],"values":[{"name":"addCommonData","comment":" Add the common data to a Environment without common data.\n","type":"cdata -> Messenger.Base.Env () userdata -> Messenger.Base.Env cdata userdata"},{"name":"getAllSprites","comment":" Get all loaded sprite textures\n","type":"Messenger.Base.Runtime -> Dict.Dict String.String REGL.Texture"},{"name":"getCanvasOffset","comment":" Get canvas positioning offset\n","type":"Messenger.Base.Runtime -> ( Basics.Float, Basics.Float )"},{"name":"getConfigData","comment":" Get loaded config data by key.\n","type":"String.String -> Messenger.Base.Runtime -> Maybe.Maybe String.String"},{"name":"getCurrentScene","comment":" Get the current scene name.\n","type":"Messenger.Base.Runtime -> String.String"},{"name":"getCurrentTimeStamp","comment":" Get the current timestamp.\n","type":"Messenger.Base.Runtime -> Basics.Float"},{"name":"getFonts","comment":" Get set of loaded font names\n","type":"Messenger.Base.Runtime -> Set.Set String.String"},{"name":"getGlobalStartFrame","comment":" Get the frame count since the game started.\n","type":"Messenger.Base.Runtime -> Basics.Int"},{"name":"getGlobalStartTime","comment":" Get elapsed time since the game started.\n","type":"Messenger.Base.Runtime -> Basics.Float"},{"name":"getLoadingProgress","comment":" Get resource loading progress (loaded, total)\n","type":"Messenger.Base.Runtime -> ( Basics.Int, Basics.Int )"},{"name":"getMousePos","comment":" Get the mouse position in virtual coordinates.\n","type":"Messenger.Base.Runtime -> ( Basics.Float, Basics.Float )"},{"name":"getPressedKeys","comment":" Get the pressed keys.\n","type":"Messenger.Base.Runtime -> Set.Set Basics.Int"},{"name":"getPressedMouseButtons","comment":" Get the pressed mouse buttons.\n","type":"Messenger.Base.Runtime -> Set.Set Basics.Int"},{"name":"getPrograms","comment":" Get set of loaded shader program names\n","type":"Messenger.Base.Runtime -> Set.Set String.String"},{"name":"getRealSize","comment":" Get real canvas dimensions\n","type":"Messenger.Base.Runtime -> ( Basics.Float, Basics.Float )"},{"name":"getSceneStartFrame","comment":" Get the frame count since the current scene started.\n","type":"Messenger.Base.Runtime -> Basics.Int"},{"name":"getSceneStartTime","comment":" Get elapsed time since the current scene started.\n","type":"Messenger.Base.Runtime -> Basics.Float"},{"name":"getSprite","comment":" Get a specific sprite texture by name\n","type":"String.String -> Messenger.Base.Runtime -> Maybe.Maybe REGL.Texture"},{"name":"getViewPort","comment":" Get browser viewport dimensions\n","type":"Messenger.Base.Runtime -> ( Basics.Float, Basics.Float )"},{"name":"getVirtualSize","comment":" Get virtual coordinate dimensions\n","type":"Messenger.Base.Runtime -> ( Basics.Float, Basics.Float )"},{"name":"getVolume","comment":" Get the current volume.\n","type":"Messenger.Base.Runtime -> Basics.Float"},{"name":"getWindowVisibility","comment":" Get the current browser visibility.\n","type":"Messenger.Base.Runtime -> Browser.Events.Visibility"},{"name":"removeCommonData","comment":" Remove common data from environment.\n\nUseful when dealing with portable components by yourself.\n\nMost of the time it will not be used since it has been built into prepared update functions.\n\n","type":"Messenger.Base.Env cdata userdata -> Messenger.Base.Env () userdata"}],"binops":[]},{"name":"Messenger.Component.Component","comment":"\n\n\n# Component\n\nA component is an object that you may put in your layers.\n\n\n## User components\n\nThese are components that you users can create with custom **basedata**.\n\nBasedata is the data that components with the same type can share.\n\nFor example, you may want a game component to have some common properties like position, velocity, etc.\n\nIn this case, your basedata would be a record with these properties.\n\n@docs AbstractComponent\n@docs ConcreteUserComponent\n@docs genComponent\n@docs updateComponents, updateComponentsWithBlock\n@docs updateComponentsWithTarget\n\n\n## View components\n\n@docs genComponentsRenderList, viewComponentsRenderList\n@docs viewComponents\n\n\n# Type sugar\n\n@docs ComponentInit, ComponentUpdate, ComponentUpdateRec, ComponentView, ComponentMatcher\n@docs ComponentStorage, LevelComponentStorage\n@docs UpdateMiddleStep, UpdateRecMiddleStep\n\n","unions":[],"aliases":[{"name":"AbstractComponent","comment":" Abstract component\n\n  - Not very likely to be used. The messenger template will handle this for you automatically.\n\n","args":["cdata","userdata","tar","msg","bdata","scenemsg"],"type":"Messenger.GeneralModel.AbstractGeneralModel Messenger.Base.Runtime (Messenger.Base.Env cdata userdata) Messenger.Base.UserEvent tar msg ( REGL.Common.Renderable, Basics.Int ) bdata (Messenger.Scene.Scene.SceneOutputMsg scenemsg userdata)"},{"name":"ComponentInit","comment":" Component init type sugar.\n\nReceives the environment and the initializing message (from which you can extract the parameters used to initialize the object, for example position),\nand returns a tuple of (Data, BaseData).\n\n  - Note: data is somehow private, but baseData is public. More precisely, baseData can be accessed safely at layer level since it is the same for every component in the layer.\n\n","args":["cdata","userdata","msg","data","bdata"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> msg -> ( data, bdata )"},{"name":"ComponentMatcher","comment":" Component matcher type sugar\nThe function that is used to judge if this component is the target of a incoming component msg (sent by OtherTar). It will return true if the incoming\ncomponentMatcher matches this component.\n\nIt receives data, basedata, and the componentMatcher value of the incoming message.\n\nHere is an example of it:\n\n    matcher : ComponentMatcher Data BaseData ComponentTarget\n    matcher data basedata tar =\n        tar == Type basedata.ty || tar == Id basedata.id\n\nWhere the matcher will return true if the id or the name matches the incoming message.\n\n","args":["data","bdata","tar"],"type":"data -> bdata -> tar -> Basics.Bool"},{"name":"ComponentStorage","comment":" Component storage type sugar\n\n  - Not very likely to be used. The messenger template will handle this for you automatically.\n\n","args":["cdata","userdata","tar","msg","bdata","scenemsg"],"type":"msg -> Messenger.Component.Component.LevelComponentStorage cdata userdata tar msg bdata scenemsg"},{"name":"ComponentUpdate","comment":" Component update type sugar\n\nDetermines the behaviour when a UserEvent is sent to the component. This could include, but not limited to, a mouse click, a keyboard press, or most commonly a time tick\n(which means a specific amount of time has passed, see the manual)\n\nReceives the environment env, the UserEvent evnt, the currect data and basedata ,and returns a structure in ((Data,BaseData),List Msg, (Env, Bool)).\n\n  - Note: The last bool determines if the message would be blocked from the next component. If it is set to be True, then all the components behind it will\n    not receive this UserEvent. This is useful when you want the action of the player only influence the front component, but not the conponents behind them.\n\n  - Note: data is somehow private, but baseData is public. More precisely, baseData can be accessed safely at layer level since it is the same for every component in the layer.\n\n","args":["cdata","data","userdata","scenemsg","tar","msg","bdata"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> Messenger.Base.UserEvent -> data -> bdata -> ( ( data, bdata ), List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), ( Messenger.Base.Env cdata userdata, Basics.Bool ) )"},{"name":"ComponentUpdateRec","comment":" Component updaterec type sugar\n\nDetermines the behaviour when other components, layers or scene sends messages to the component. For example, a knife component may send a message to the monster component to decrease its blood.\n\nReceives the environment env, the component messages (defined in ComponentBase.elm), the currect data and basedata ,and returns a structure in ((Data,BaseData),List Msg, Env).\n\n  - Note: data is somehow private, but baseData is public. More precisely, baseData can be accessed safely at layer level since it is the same for every component in the layer.\n\n","args":["cdata","data","userdata","scenemsg","tar","msg","bdata"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> msg -> data -> bdata -> ( ( data, bdata ), List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), Messenger.Base.Env cdata userdata )"},{"name":"ComponentView","comment":" Component view type sugar\n\nRenders the component. If you want to render multiple things, you should use Canvas.group to assemble them into one renderable.\nThe second entry of the returning tuple is the \"z-index\" of the component. For example, if you want to put something important to the toppest layer of the window (Like the mouse cursor),\nyou can set it to a very high value(like 1000).\n\nReceives environment, data, and basedata.\n\n","args":["cdata","userdata","data","bdata"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> data -> bdata -> ( REGL.Common.Renderable, Basics.Int )"},{"name":"ConcreteUserComponent","comment":" ConcreteUserComponent\n\nNot very likely to be used. The messenger template will handle this for you automatically.\n\n","args":["data","cdata","userdata","tar","msg","bdata","scenemsg"],"type":"Messenger.GeneralModel.ConcreteGeneralModel data Messenger.Base.Runtime (Messenger.Base.Env cdata userdata) Messenger.Base.UserEvent tar msg ( REGL.Common.Renderable, Basics.Int ) bdata (Messenger.Scene.Scene.SceneOutputMsg scenemsg userdata)"},{"name":"LevelComponentStorage","comment":" Level component storage type sugar\n\n  - Not very likely to be used. The messenger template will handle this for you automatically.\n\n","args":["cdata","userdata","tar","msg","bdata","scenemsg"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> Messenger.Component.Component.AbstractComponent cdata userdata tar msg bdata scenemsg"},{"name":"UpdateMiddleStep","comment":" This is a type sugar for dividing a long update function into smaller pieces to enhance code quality. It receives a ((Data,BaseData),List Msg, (Env, Bool)) and returns a tuple of same kind.\nHere is a piece of sample code:\n\n    judgeMsg : UpdateMiddleStep SceneCommonData Data UserData SceneMsg ComponentTarget ComponentMsg BaseData\n    judgeMsg ( ( data, basedata ), msg, ( env, bool ) ) =\n        ( ( data, basedata ), msg, ( env, False ) )\n\nAfter defining this, using this in Update is as simple a a cup of tea.\n\n    case evnt of\n        Tick t ->\n            ( ( data, basedata ), [], ( env, False ) )\n                |> judgeMsg\n\n  - Note: you may add extra argument to your function like this:\n\n    `myFunc : Int -> UpdateMiddleStep`\n\n    and call like this:\n\n    `( ( data, basedata ), [], ( env, False ) ) |> myFunc 1`\n\n","args":["cdata","data","userdata","scenemsg","tar","msg","bdata"],"type":"( ( data, bdata ), List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), ( Messenger.Base.Env cdata userdata, Basics.Bool ) ) -> ( ( data, bdata ), List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), ( Messenger.Base.Env cdata userdata, Basics.Bool ) )"},{"name":"UpdateRecMiddleStep","comment":" This is a type sugar for dividing a long updateRec function into smaller pieces to enhance code quality. It receives a ((Data,BaseData),List Msg, Env) and returns a tuple of same kind.\nIt is really similar to UpdateMiddleStep, see the examples there.\n","args":["cdata","data","userdata","scenemsg","tar","msg","bdata"],"type":"( ( data, bdata ), List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), Messenger.Base.Env cdata userdata ) -> ( ( data, bdata ), List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), Messenger.Base.Env cdata userdata )"}],"values":[{"name":"genComponent","comment":" Generate abstract user component from concrete component.\n\n  - Not very likely to be used. The messenger template will handle this for you automatically.\n\n","type":"Messenger.Component.Component.ConcreteUserComponent data cdata userdata tar msg bdata scenemsg -> Messenger.Component.Component.ComponentStorage cdata userdata tar msg bdata scenemsg"},{"name":"genComponentsRenderList","comment":" Generate render list for one list of components.\n\nUseful when there are several component lists.\n\nThe output should be used as the input of `viewComponentsRenderList`.\n\n  - Not very likely to be used. The messenger template will handle this for you automatically.\n\n","type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> List.List (Messenger.Component.Component.AbstractComponent cdata userdata tar msg bdata scenemsg) -> List.List ( REGL.Common.Renderable, Basics.Int )"},{"name":"updateComponents","comment":" Update a list of abstract user components.\n","type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> Messenger.Base.UserEvent -> List.List (Messenger.Component.Component.AbstractComponent cdata userdata tar msg bdata scenemsg) -> ( List.List (Messenger.Component.Component.AbstractComponent cdata userdata tar msg bdata scenemsg), List.List (Messenger.Scene.Scene.MMsgBase msg scenemsg userdata), ( Messenger.Base.Env cdata userdata, Basics.Bool ) )"},{"name":"updateComponentsWithBlock","comment":" Update a list of abstract user components with block indicator.\n\nIt block is True, this function will not update anything.\n\n  - Not very likely to be used. The messenger template will handle this for you automatically.\n\n","type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> Messenger.Base.UserEvent -> Basics.Bool -> List.List (Messenger.Component.Component.AbstractComponent cdata userdata tar msg bdata scenemsg) -> ( List.List (Messenger.Component.Component.AbstractComponent cdata userdata tar msg bdata scenemsg), List.List (Messenger.Scene.Scene.MMsgBase msg scenemsg userdata), ( Messenger.Base.Env cdata userdata, Basics.Bool ) )"},{"name":"updateComponentsWithTarget","comment":" Update a list of abstract user components with targeted msgs.\n\n  - Not very likely to be used. The messenger template will handle this for you automatically.\n\n","type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> List.List ( tar, msg ) -> List.List (Messenger.Component.Component.AbstractComponent cdata userdata tar msg bdata scenemsg) -> ( List.List (Messenger.Component.Component.AbstractComponent cdata userdata tar msg bdata scenemsg), List.List (Messenger.Scene.Scene.MMsgBase msg scenemsg userdata), Messenger.Base.Env cdata userdata )"},{"name":"viewComponents","comment":" View one list of abstract components.\n\nUsed when there is only one list of components\n\n","type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> List.List (Messenger.Component.Component.AbstractComponent cdata userdata tar msg bdata scenemsg) -> REGL.Common.Renderable"},{"name":"viewComponentsRenderList","comment":" View the render list of components.\n\nUseful when there are several component lists.\n\nThe input should be generated by several `genComponentsRenderList`.\n\n","type":"List.List ( REGL.Common.Renderable, Basics.Int ) -> REGL.Common.Renderable"}],"binops":[]},{"name":"Messenger.Component.GlobalComponent","comment":"\n\n\n# Global Component\n\nGlobal components are Messenger objects that live outside the current scene.\nThey receive user events before the scene, can emit scene output messages, and\ncan add post-processing effects to the rendered scene. Typical examples are FPS\noverlays, transitions, loading screens, and global UI.\n\n@docs genGlobalComponent\n@docs filterAliveGC\n@docs combinePP\n\n","unions":[],"aliases":[],"values":[{"name":"combinePP","comment":" Collect post processors from all global components.\n\nThe returned list is applied to the scene renderable in order. Global components\nthat do not need post-processing should keep `postProcessor = identity`.\n\n","type":"List.List (Messenger.Scene.Scene.AbstractGlobalComponent userdata scenemsg) -> List.List (REGL.Common.Renderable -> REGL.Common.Renderable)"},{"name":"filterAliveGC","comment":" Filter out dead global components.\n\nGlobal components mark themselves as dead by setting `baseData.dead` to `True`.\nMessenger calls this helper each update so dead components stop receiving events\nand stop rendering.\n\n","type":"List.List (Messenger.Scene.Scene.AbstractGlobalComponent userdata scenemsg) -> List.List (Messenger.Scene.Scene.AbstractGlobalComponent userdata scenemsg)"},{"name":"genGlobalComponent","comment":" Generate an abstract global component from a concrete global component.\n\nThe second argument is the initialization message (`GCMsg`). The optional target\noverrides the component's default `id`, which is useful when loading multiple\ninstances of the same global component type.\n\n","type":"Messenger.Scene.Scene.ConcreteGlobalComponent data userdata scenemsg -> Messenger.Scene.Scene.GCMsg -> Maybe.Maybe Messenger.Scene.Scene.GCTarget -> Messenger.Base.Runtime -> Messenger.Base.Env (Messenger.Scene.Scene.GCCommonData userdata scenemsg) userdata -> Messenger.Scene.Scene.AbstractGlobalComponent userdata scenemsg"}],"binops":[]},{"name":"Messenger.Coordinate.Camera","comment":"\n\n\n# Camera Tools\n\n@docs setCameraPos, setCameraScale, setCameraAngle\n@docs defaultCamera, worldToView, viewToWorld\n\n","unions":[],"aliases":[],"values":[{"name":"defaultCamera","comment":" Default camera for the game.\n","type":"Messenger.Base.Runtime -> REGL.Common.Camera"},{"name":"setCameraAngle","comment":" Set the camera angle.\n","type":"Basics.Float -> Messenger.Base.GlobalData u -> Messenger.Base.GlobalData u"},{"name":"setCameraPos","comment":" Set the camera position.\n","type":"( Basics.Float, Basics.Float ) -> Messenger.Base.GlobalData u -> Messenger.Base.GlobalData u"},{"name":"setCameraScale","comment":" Set the camera scale.\n","type":"Basics.Float -> Messenger.Base.GlobalData u -> Messenger.Base.GlobalData u"},{"name":"viewToWorld","comment":" Transform a position from the view coordinate system to the world coordinate system.\n\nThis is the inverse of `worldToView`.\n\n","type":"REGL.Common.Camera -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float )"},{"name":"worldToView","comment":" Tranform a position from the world coordinate system to the view (camera) coordinate system.\n","type":"REGL.Common.Camera -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float )"}],"binops":[]},{"name":"Messenger.Coordinate.Coordinates","comment":"\n\n\n# Coordinate\n\nThis module deals with the coordinate transformation.\n\nNormally, users do not need to use this module directly, as Messenger will handle the coordinate transformation for you.\n\n@docs fixedPosToReal\n@docs posToReal, posToVirtual\n@docs lengthToReal\n@docs fromRealLength\n@docs maxHandW\n@docs getStartPoint\n@docs judgeMouseRect\n@docs judgeMouseCircle\n@docs judgeMouseRectWithCamera\n@docs fromMouseToVirtual\n\n","unions":[],"aliases":[],"values":[{"name":"fixedPosToReal","comment":" Same as posToReal, but add the initial position of canvas. That is to say, the function returns the actual coordinate of the point **on the whole screen** of your computer, so it is dependent on the location of your browser windows.\n\nExample: If your screen is 2560\\*1440, the virtual canvas size is 1920\\*1080 and the actual window size 960\\*540 at the center of screen, then the function will map (600,300) to (2560/2-960/2+(960/1920)\\*600,1440/2-540/2+(540/1080)\\*300) = (1100,600)\n\n","type":"Messenger.Base.Runtime -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float )"},{"name":"fromMouseToVirtual","comment":" fromMouseToVirtual conveys the mouse position in the Screen coordinate to the virtual coordinate. In most cases Messenger does this for you.\n\nThe coordinate in the globalData is already in virtual coordinates.\n\n","type":"Messenger.Base.Runtime -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float )"},{"name":"fromRealLength","comment":" The inverse function of widthToReal. Turns the length in real length to virtual length.\n\n  - Note: In the case the actual width-length ratio of the window is different from the virtual ratio, the zooming ratio is calculated based on the WIDTH ratio between the real and virtual canvas size.\n    Usage: `lengthToReal gd x`\n\n  - gd is the internal data.\n\n  - x is the length in real coordinate system.\n\nThe function returns the length in virtual coordinate system.\n\n","type":"Messenger.Base.Runtime -> Basics.Float -> Basics.Float"},{"name":"getStartPoint","comment":" Get the start point of the virtual canvas in the real canvas.\n\nUsed internally.\n\n","type":"( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float )"},{"name":"judgeMouseCircle","comment":" Judge whether the mouse position is in the circle.\n","type":"( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> Basics.Float -> Basics.Bool"},{"name":"judgeMouseRect","comment":" Judge whether the mouse position is in the rectangle.\nUsage: `judgeMouseRect ( mx, my ) ( x, y ) ( w, h )`\n\n  - (mx,my) is the coordinate of the mouse, which you can get easily from globalData.\n  - (x,y) is the starting point(left-top corner) of the desired rectangle.\n  - (w,h) is the width and length of the desired rectangle.\n\nThe function returns a bool indicating whether the mouse is in the rectangle.\n\n","type":"( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> Basics.Bool"},{"name":"judgeMouseRectWithCamera","comment":" Judge whether the mouse position is in the rectangle, with camera.\n","type":"Messenger.Base.Runtime -> REGL.Common.Camera -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> Basics.Bool"},{"name":"lengthToReal","comment":" Use this if you want to draw something based on the length. It turns the virtual length to real length.\nFor example, if the actual window is 960\\*540 and the virtual one is 1920\\*1080, then the function will map 300(virtual length) to 150(real length)\n\n  - Note: In the case the actual width-length ratio of the window is different from the virtual ratio, the zooming ratio is calculated based on the WIDTH ratio between the real and virtual canvas size.\n\nUsage: `lengthToReal gd x`\n\n  - gd is the internal data.\n  - x is the length in virtual coordinate system.\n\nThe function returns the length in real coordinate system.\n\n","type":"Messenger.Base.Runtime -> Basics.Float -> Basics.Float"},{"name":"maxHandW","comment":" Used internally.\n","type":"( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float )"},{"name":"posToReal","comment":" Transform from the virtual coordinate system to the real pixel system.\n\nFor example, if you virtual canvas is 1920\\*1080 but your real window is 960\\*540, then the function will map a point at (1200,600) to (600,300).\n\nUsage : `posToReal gd ( x, y )` where (x,y) is the virtual coordinates and gd the internal data.\n\nThe function returns the position in real canvas.\n\n","type":"Messenger.Base.Runtime -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float )"},{"name":"posToVirtual","comment":" Inverse of posToReal. This is helpful if you need to render sprite with real coordinates.\n\nUsage : `posToReal gd ( x, y )` where (x,y) is the real coordinates and gd the internal data.\nThe function returns the coordinate in virtual coordinate system.\n\n","type":"Messenger.Base.Runtime -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float )"}],"binops":[]},{"name":"Messenger.Coordinate.HTML","comment":"\n\n\n# HTML Coordinate Lib\n\nHelpers for positioning `extraHTML` elements in the same virtual coordinate\nsystem as the game canvas.\n\n@docs genAttribute\n\n","unions":[],"aliases":[],"values":[{"name":"genAttribute","comment":" Generate HTML attributes for a virtual rectangle.\n\nThe first argument is the Messenger runtime. The `( x, y )` argument is the\nvirtual top-left position, and `( w, h )` is the virtual size. The generated\nattributes use fixed browser positioning and automatically account for canvas\nscale and offset.\n\n","type":"Messenger.Base.Runtime -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> List.List (Html.Attribute msg)"}],"binops":[]},{"name":"Messenger.GeneralModel","comment":"\n\n\n# General Model\n\nGeneral model is designed to be an abstract interface of layers, components, etc..\n\nA General model has the ability to:\n\n  - specialize its own data types\n  - share some data types with objects in the same type\n  - be initialized by some inputs\n  - be updated by event and msgs\n  - be updated in a list of same type objects\n  - send msg to the objects in the same type\n  - send msg to the parent object\n  - render itself\n  - identify itself by a matcher\n\n@docs Msg, MsgBase, filterSOM\n@docs ConcreteGeneralModel, AbstractGeneralModel\n@docs unroll, abstract\n@docs viewModelList\n@docs Matcher\n\n\n## Result Remap\n\n@docs updateResultRemap, updaterecResultRemap\n\n","unions":[{"name":"AbstractGeneralModel","comment":" Rolled Abstract General Model.\n\nCannot be directedly modified.\nUsed for storage.\n\n","args":["envro","env","event","tar","msg","ren","bdata","sommsg"],"cases":[["Roll",["Messenger.GeneralModel.UnrolledAbstractGeneralModel envro env event tar msg ren bdata sommsg"]]]},{"name":"Msg","comment":" The Basic Msg Model.\n\nUsing **Other** when sending msg to objects in the same type.\nMake sure the `othertar` can pass the matcher of target object.\n\nExamples:\n\n  - Parent <| SOMMsg <| SOMChangeScene (Just NullSceneMsg) \"SelectLevel\" -- Parent\n  - Other <| ( Type \"Camera\", CameraShakeMsg 1 200 ) -- Note here Type \"Camera\" is of Matcher Type (Defined by the user) which indicates the target of the message, and the desired message is the second entry of the tuple.\n\n","args":["othertar","msg","sommsg"],"cases":[["Parent",["Messenger.GeneralModel.MsgBase msg sommsg"]],["Other",["( othertar, msg )"]]]},{"name":"MsgBase","comment":" MsgBase\n\nUsed when sending a msg to parent object.\n\nUsing **SOMMsg** when sending a `SceneOutputMsg`, which will be directly handled by Top-level.\nUse **OtherMsg** when sending a normal message to parent.\n\nExamples:\n\n  - Parent <| SOMMsg <| SOMChangeScene (Just NullSceneMsg) \"SelectLevel\" -- SOMMsg\n  - Parent <| OtherMsg <| genMeteor env.commonData.playerPos (getGlobalStartTime env.globalData) -- In a component. This genMeteor message will be handled in the layer containing the component.\n\n","args":["othermsg","sommsg"],"cases":[["SOMMsg",["sommsg"]],["OtherMsg",["othermsg"]]]}],"aliases":[{"name":"ConcreteGeneralModel","comment":" Concrete General Model.\n\nUsers deal with the fields in concrete model. That is to say, you should implement the init,update,updaterec,view and matcher function in the model.\n\n","args":["data","envro","env","event","tar","msg","ren","bdata","sommsg"],"type":"{ init : envro -> env -> msg -> ( data, bdata ), update : envro -> env -> event -> data -> bdata -> ( ( data, bdata ), List.List (Messenger.GeneralModel.Msg tar msg sommsg), ( env, Basics.Bool ) ), updaterec : envro -> env -> msg -> data -> bdata -> ( ( data, bdata ), List.List (Messenger.GeneralModel.Msg tar msg sommsg), env ), view : envro -> env -> data -> bdata -> ren, matcher : data -> bdata -> tar -> Basics.Bool }"},{"name":"Matcher","comment":" A general matcher type sugar\n\nSimilar to the matcher function implemented by user in the components and layers.\n\n","args":["data","tar"],"type":"data -> tar -> Basics.Bool"}],"values":[{"name":"abstract","comment":" Abstract a concrete model to an abstract model.\n\nInitialize it with env and msg.\nMessenger will handle this for you.\n\n","type":"Messenger.GeneralModel.ConcreteGeneralModel data envro env event tar msg ren bdata sommsg -> msg -> envro -> env -> Messenger.GeneralModel.AbstractGeneralModel envro env event tar msg ren bdata sommsg"},{"name":"filterSOM","comment":" Filter SOMMsg from list of MsgBase.\n\n  - Not very likely to be used. The messenger template will handle this for you automatically.\n\n","type":"List.List (Messenger.GeneralModel.MsgBase othermsg sommsg) -> List.List sommsg"},{"name":"unroll","comment":" Unroll a rolled abstract model. In this way, you retrieve the data from the storage.\nThis is useful when you want to manipulate and calculate the reactions between components, like in collision handling process.\nFor example, the following function called by the layer can read the position of from AbstractComponent.\nlet\nx\\_data = unroll x\nposX=x\\_data.baseData.position\nin\n...\n","type":"Messenger.GeneralModel.AbstractGeneralModel envro env event tar msg ren bdata sommsg -> Messenger.GeneralModel.UnrolledAbstractGeneralModel envro env event tar msg ren bdata sommsg"},{"name":"updateResultRemap","comment":" Change the `update` function to remap the result and return the changed abstract general model.\n\n  - Not very likely to be used. The messenger template will handle this for you automatically.\n\n","type":"(( List.List (Messenger.GeneralModel.Msg tar msg sommsg), ( env, Basics.Bool ) ) -> ( List.List (Messenger.GeneralModel.Msg tar msg sommsg), ( env, Basics.Bool ) )) -> Messenger.GeneralModel.AbstractGeneralModel envro env event tar msg ren bdata sommsg -> Messenger.GeneralModel.AbstractGeneralModel envro env event tar msg ren bdata sommsg"},{"name":"updaterecResultRemap","comment":" Change the `updaterec` function to remap the result and return the changed abstract general model.\n\n  - Not very likely to be used. The messenger template will handle this for you automatically.\n\n","type":"(( List.List (Messenger.GeneralModel.Msg tar msg sommsg), env ) -> ( List.List (Messenger.GeneralModel.Msg tar msg sommsg), env )) -> Messenger.GeneralModel.AbstractGeneralModel envro env event tar msg ren bdata sommsg -> Messenger.GeneralModel.AbstractGeneralModel envro env event tar msg ren bdata sommsg"},{"name":"viewModelList","comment":" View model list.\n\n  - Not very likely to be used. The messenger template will handle this for you automatically.\n\n","type":"envro -> Messenger.Base.Env common userdata -> List.List (Messenger.GeneralModel.AbstractGeneralModel envro (Messenger.Base.Env common userdata) Messenger.Base.UserEvent tar msg REGL.Common.Renderable bdata sommsg) -> List.List REGL.Common.Renderable"}],"binops":[]},{"name":"Messenger.Layer.Layer","comment":"\n\n\n# Layer\n\nGeneral Model and Helper functions for Layers.\n\n@docs ConcreteLayer, AbstractLayer\n\n\n## Generate\n\n@docs genLayer\n\n\n## Update\n\n@docs Handler\n@docs handleComponentMsgs\n@docs LayerInit, LayerUpdate, LayerUpdateRec, LayerView\n@docs LayerStorage\n@docs LayerUpdateMiddleStep, LayerUpdateRecMiddleStep\n\n","unions":[],"aliases":[{"name":"AbstractLayer","comment":" Abstract Layer Model.\n\nCannot be directedly modified.\nUsed for storage.\n\n","args":["cdata","userdata","tar","msg","scenemsg"],"type":"Messenger.Scene.Scene.MAbstractGeneralModel cdata userdata tar msg () scenemsg"},{"name":"ConcreteLayer","comment":" Concrete Layer Model\n\nUsers deal with the fields in concrete model.\n\n","args":["data","cdata","userdata","tar","msg","scenemsg"],"type":"{ init : Messenger.Layer.Layer.LayerInit cdata userdata msg data, update : Messenger.Layer.Layer.LayerUpdate cdata userdata tar msg scenemsg data, updaterec : Messenger.Layer.Layer.LayerUpdateRec cdata userdata tar msg scenemsg data, view : Messenger.Layer.Layer.LayerView cdata userdata data, matcher : Messenger.GeneralModel.Matcher data tar }"},{"name":"Handler","comment":" Handler Type.\n\nA handler is used to handle the Component Msg sent to the layer.\n\n**Make handler for every type of component msg.**\n\n","args":["data","cdata","userdata","tar","msg","scenemsg","cmsg"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> Messenger.Scene.Scene.MMsgBase cmsg scenemsg userdata -> data -> ( data, List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), Messenger.Base.Env cdata userdata )"},{"name":"LayerInit","comment":" init type sugar\nThe initializing function for layer. It receives the environment, the initializing message, and returns the layer's data.\n","args":["cdata","userdata","msg","data"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> msg -> data"},{"name":"LayerStorage","comment":" Layer Storage\n\nNot very likely to be used. The messenger template will handle this for you automatically.\n\n","args":["cdata","userdata","tar","msg","scenemsg"],"type":"msg -> Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> Messenger.Layer.Layer.AbstractLayer cdata userdata tar msg scenemsg"},{"name":"LayerUpdate","comment":" update type sugar\n\nDetermines the behaviour when a UserEvent is sent to the layer. This could include, but not limited to, a mouse click, a keyboard press, or most commonly a time tick\n(which means a specific amount of time has passed, see the manual). In most cases you should distribute the events to the components belonging to the group.\n\nReceives the environment env, the UserEvent evnt, the currect data of the layer ,and returns a structure in (Data ,List Msg, (Env, Bool)).\n\n  - Note: The last bool determines if the message would be blocked from the next layer. If it is set to be True, then all the layers behind it(generated after it\n    in the initializing of scene) will not receive this UserEvent. This is useful when you want the action of the player only influence the front layers, but not the layers behind them.\n  - Note: This function is also the place where you should handle the routine chores of the layers and collect component message. For more information please read the 5-step update framework in the manual.\n\n","args":["cdata","userdata","tar","msg","scenemsg","data"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> Messenger.Base.UserEvent -> data -> ( data, List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), ( Messenger.Base.Env cdata userdata, Basics.Bool ) )"},{"name":"LayerUpdateMiddleStep","comment":" This is a type sugar for dividing a long update function into smaller pieces to enhance code quality. It receives a ((Data,BaseData),List Msg, (Env,bool)) and returns a tuple of same kind.\nIt is really similar to UpdateMiddleStep(which is in Component.elm), see the examples there.\n","args":["cdata","data","userdata","scenemsg","tar","msg"],"type":"( data, List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), ( Messenger.Base.Env cdata userdata, Basics.Bool ) ) -> ( data, List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), ( Messenger.Base.Env cdata userdata, Basics.Bool ) )"},{"name":"LayerUpdateRec","comment":" updaterec type sugar\n\nDetermines the behaviour when other components or layers sends messages to the layer. The layer then use the message to change its state, initializing components and/or send relavent message to its component.\n\nReceives the environment env, the layer messages (defined in LayerBase.elm), the currect data, and returns a structure in (Data,List Msg, Env).\n\n","args":["cdata","userdata","tar","msg","scenemsg","data"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> msg -> data -> ( data, List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), Messenger.Base.Env cdata userdata )"},{"name":"LayerUpdateRecMiddleStep","comment":" This is a type sugar for dividing a long updateRec function into smaller pieces to enhance code quality. It receives a ((Data,BaseData),List Msg, Env) and returns a tuple of same kind.\nIt is really similar to UpdateMiddleStep(which is in Component.elm), see the examples there.\n","args":["cdata","data","userdata","scenemsg","tar","msg"],"type":"( data, List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), Messenger.Base.Env cdata userdata ) -> ( data, List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), Messenger.Base.Env cdata userdata )"},{"name":"LayerView","comment":" view type sugar\nRenders the layer. Note that there is no need for you to render the components of the layer. Instead, you can render the background of the map or the decoration of the windows here.\n\nReceives the environment and the data of the layer.\n\n","args":["cdata","userdata","data"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> data -> REGL.Common.Renderable"}],"values":[{"name":"genLayer","comment":" Generate abstract layer by a concrete layer.\n\nInitialize it with env and msg.\nNot very likely to be used. The messenger template will handle this for you automatically.\n\n","type":"Messenger.Layer.Layer.ConcreteLayer data cdata userdata tar msg scenemsg -> Messenger.Layer.Layer.LayerStorage cdata userdata tar msg scenemsg"},{"name":"handleComponentMsgs","comment":" Handle a list of component msgs.\n\n**Note that for several list of component msgs with different types, you may have to use this function repeatedly.**\n\n  - Note its main use is to deal with all the component msgs with the component message handler function (which is designed to handle one message) provided by the user. In real case just\n    determine the handler function and put it as a parameter of this function.\n\n","type":"Messenger.Base.Runtime -> Messenger.Base.Env cdata userdata -> List.List (Messenger.Scene.Scene.MMsgBase cmsg scenemsg userdata) -> data -> List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata) -> Messenger.Layer.Layer.Handler data cdata userdata tar msg scenemsg cmsg -> ( data, List.List (Messenger.Scene.Scene.MMsg tar msg scenemsg userdata), Messenger.Base.Env cdata userdata )"}],"binops":[]},{"name":"Messenger.Recursion","comment":"\n\n\n# Recursion List\n\nLow-level helpers for updating lists of Messenger general models.\n\nMost games should use the component and layer helpers generated in templates.\nUse this module when building your own abstraction over\n`Messenger.GeneralModel.AbstractGeneralModel`.\n\n@docs updateObjects, updateObjectsWithTarget\n@docs removeObjects\n\n","unions":[],"aliases":[],"values":[{"name":"removeObjects","comment":" Remove all objects that match a target.\n","type":"tar -> List.List (Messenger.GeneralModel.AbstractGeneralModel envro env event tar msg ren bdata sommsg) -> List.List (Messenger.GeneralModel.AbstractGeneralModel envro env event tar msg ren bdata sommsg)"},{"name":"updateObjects","comment":" Update every object once with an event, then deliver generated target messages.\n\nThe returned tuple contains the updated objects, parent/system messages, and the\nfinal environment plus a block flag. If an object blocks the event, later objects\ndo not receive the original event, but queued target messages are still delivered\nafterwards.\n\n","type":"envro -> env -> event -> List.List (Messenger.GeneralModel.AbstractGeneralModel envro env event tar msg ren bdata sommsg) -> ( List.List (Messenger.GeneralModel.AbstractGeneralModel envro env event tar msg ren bdata sommsg), List.List (Messenger.GeneralModel.MsgBase msg sommsg), ( env, Basics.Bool ) )"},{"name":"updateObjectsWithTarget","comment":" Deliver target messages to a list of objects.\n\nEach `( target, msg )` pair is sent to every object whose matcher accepts the\ntarget. Messages generated during delivery are recursively delivered until no\ntarget messages remain.\n\n","type":"envro -> env -> List.List ( tar, msg ) -> List.List (Messenger.GeneralModel.AbstractGeneralModel envro env event tar msg ren bdata sommsg) -> ( List.List (Messenger.GeneralModel.AbstractGeneralModel envro env event tar msg ren bdata sommsg), List.List (Messenger.GeneralModel.MsgBase msg sommsg), env )"}],"binops":[]},{"name":"Messenger.Render.Texture","comment":"\n\n\n# Texture Rendering\n\n@docs renderSprite\n@docs textureDim\n\n","unions":[],"aliases":[],"values":[{"name":"renderSprite","comment":" Render a sprite with the size automatically calculated from the texture.\n","type":"Messenger.Base.Runtime -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> String.String -> REGL.Common.Renderable"},{"name":"textureDim","comment":" Get the width and height of a texture.\n","type":"Messenger.Base.Runtime -> String.String -> ( Basics.Int, Basics.Int )"}],"binops":[]},{"name":"Messenger.Resources.Base","comment":"\n\n\n# Resource\n\nResource definitions used by Messenger's loader.\n\nResources are declared as `( name, ResourceDef )` pairs. Messenger loads initial\nresources before normal updates begin, and dynamic resources can be loaded later\nwith `SOMLoadResource`.\n\nLoaded data is stored in opaque internal engine state. User code should use\ngetters from `Messenger.Base` such as `getLoadingProgress`, `getSprite`,\n`getFonts`, `getPrograms`, and `getConfigData`.\n\n@docs saveSprite\n@docs igetSprite\n@docs ResourceDef, ResourceDefs, resourceNum\n\n","unions":[{"name":"ResourceDef","comment":" Definition for a loadable resource.\n\n  - `TextureRes url options` loads an image texture.\n  - `AudioRes url` loads an audio source.\n  - `FontRes textureUrl jsonUrl` loads an MSDF font.\n  - `ProgramRes program` creates a custom REGL program.\n  - `DataRes path` loads a plain text data file.\n\n","args":[],"cases":[["TextureRes",["String.String","Maybe.Maybe REGL.TextureOptions"]],["AudioRes",["String.String"]],["FontRes",["String.String","String.String"]],["ProgramRes",["REGL.Program.REGLProgram"]],["DataRes",["String.String"]]]}],"aliases":[{"name":"ResourceDefs","comment":" A list of named resource definitions.\n","args":[],"type":"List.List ( String.String, Messenger.Resources.Base.ResourceDef )"}],"values":[{"name":"igetSprite","comment":" Get a texture by name from a texture dictionary.\n\nThis is a low-level helper used by texture rendering internals.\n\n","type":"String.String -> Dict.Dict String.String REGL.Texture -> Maybe.Maybe REGL.Texture"},{"name":"resourceNum","comment":" Count resource definitions.\n\nMessenger uses this to track loading progress.\n\n","type":"Messenger.Resources.Base.ResourceDefs -> Basics.Int"},{"name":"saveSprite","comment":" Save a loaded texture into the texture dictionary.\n\nThis is used internally by the loader. User code usually reads textures through\n`Messenger.Base.getSprite` or renders by name with `Messenger.Render.Texture`.\n\n","type":"Dict.Dict String.String REGL.Texture -> String.String -> REGL.Texture -> Dict.Dict String.String REGL.Texture"}],"binops":[]},{"name":"Messenger.Scene.LayeredScene","comment":"\n\n\n# Layered Scene\n\nLayered scene is a pre-defined scene implementation provided by Messenger.\nA layered scene stores scene common data plus a list of layers. All layers in\nthe list share the same common-data, target, message, user-data, and scene-message\ntypes.\n\n@docs LayeredSceneData\n@docs genLayeredScene\n@docs LayeredSceneInit, LayeredSceneEffectFunc\n\n\n## Scene Prototype\n\n@docs LayeredSceneProtoInit, LayeredSceneLevelInit, initCompose\n\n","unions":[],"aliases":[{"name":"LayeredSceneData","comment":" Layered scene data.\n\n  - `renderSettings` is passed to `REGL.Common.group` when viewing all layers.\n  - `commonData` is shared by all layers in the scene.\n  - `layers` stores the scene's abstract layers.\n\nHere is an example for it:\n\n    { renderSettings = []\n    , commonData = cd\n    , layers =\n        [ Main.layer (MainInitData { components = comps, fakeBricks = fakes, isBoss = isBoss }) envcd\n        , TechTree.layer NullLayerMsg envcd\n        , TextLayer.layer (TextInitData levelName) envcd\n        , PauseLayer.layer NullLayerMsg envcd\n        , Guide.layer NullLayerMsg envcd\n        ]\n    }\n\n","args":["cdata","userdata","tar","msg","scenemsg"],"type":"{ renderSettings : List.List REGL.Common.Effect, commonData : cdata, layers : List.List (Messenger.Layer.Layer.AbstractLayer cdata userdata tar msg scenemsg) }"},{"name":"LayeredSceneEffectFunc","comment":" Effect function type for layered scenes.\n\nIt runs during scene update and returns render effects used when all layers are\ngrouped.\n\n","args":["cdata","userdata","tar","msg","scenemsg"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env () userdata -> Messenger.Base.UserEvent -> Messenger.Scene.LayeredScene.LayeredSceneData cdata userdata tar msg scenemsg -> List.List REGL.Common.Effect"},{"name":"LayeredSceneInit","comment":" Init type for normal (not prototype) layered scenes.\n\nIt receives the environment and optional scene message, then returns the initial\n`LayeredSceneData`.\n\n       { renderSettings = []\n        , commonData = cd\n        , layers =\n            [ Opening.layer NullLayerMsg envcd ]\n        }\n\n","args":["cdata","userdata","tar","msg","scenemsg"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env () userdata -> Maybe.Maybe scenemsg -> Messenger.Scene.LayeredScene.LayeredSceneData cdata userdata tar msg scenemsg"},{"name":"LayeredSceneLevelInit","comment":" Level init type for layered scene prototypes.\n\nThis converts a normal scene message into prototype initialization data.\n\n","args":["userdata","scenemsg","idata"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env () userdata -> Maybe.Maybe scenemsg -> Maybe.Maybe idata"},{"name":"LayeredSceneProtoInit","comment":" Prototype init type for layered scene prototypes.\n\nIt receives the environment and prototype initialization data, then returns\n`LayeredSceneData`.\n\n","args":["cdata","userdata","tar","msg","scenemsg","idata"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env () userdata -> Maybe.Maybe idata -> Messenger.Scene.LayeredScene.LayeredSceneData cdata userdata tar msg scenemsg"}],"values":[{"name":"genLayeredScene","comment":" Generate scene storage for a layered scene.\n\n  - `init` creates the initial layered scene data.\n\n  - `settingsFunc` updates `renderSettings` each time the scene updates. If you\n    do not need dynamic effects, provide `\\_ _ data -> data.renderSettings`.\n\n","type":"Messenger.Scene.LayeredScene.LayeredSceneInit cdata userdata tar msg scenemsg -> Messenger.Scene.LayeredScene.LayeredSceneEffectFunc cdata userdata tar msg scenemsg -> Messenger.Scene.Scene.SceneStorage userdata scenemsg"},{"name":"initCompose","comment":" Compose prototype init with level init.\n","type":"Messenger.Scene.LayeredScene.LayeredSceneProtoInit cdata userdata tar msg scenemsg idata -> Messenger.Scene.LayeredScene.LayeredSceneLevelInit userdata scenemsg idata -> Messenger.Base.Runtime -> Messenger.Base.Env () userdata -> Maybe.Maybe scenemsg -> Messenger.Scene.LayeredScene.LayeredSceneData cdata userdata tar msg scenemsg"}],"binops":[]},{"name":"Messenger.Scene.RawScene","comment":"\n\n\n# Raw Scene\n\nA raw scene owns all of its data directly. It has no built-in layers or\ncomponents, so it is useful for simple scenes or for custom scene structures that\ndo not fit Messenger's layered scene helper.\n\n@docs RawSceneInit, RawSceneUpdate, RawSceneView\n@docs genRawScene\n\n\n## Scene Prototype\n\n@docs RawSceneProtoInit, RawSceneProtoLevelInit, initCompose\n\n","unions":[],"aliases":[{"name":"RawSceneInit","comment":" Raw scene init type.\n\nInitialize scene data from the environment and optional scene message.\n\n","args":["data","userdata","scenemsg"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env () userdata -> Maybe.Maybe scenemsg -> data"},{"name":"RawSceneProtoInit","comment":" Prototype init type for raw scene prototypes.\n\nThis creates scene data from prototype initialization data.\n\n","args":["data","userdata","idata"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env () userdata -> Maybe.Maybe idata -> data"},{"name":"RawSceneProtoLevelInit","comment":" Level init type for raw scene prototypes.\n\nThis converts a normal scene message into the prototype-specific initialization\ndata. It is commonly used by generated scene-prototype levels.\n\n","args":["userdata","scenemsg","idata"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env () userdata -> Maybe.Maybe scenemsg -> Maybe.Maybe idata"},{"name":"RawSceneUpdate","comment":" Raw scene update type.\n\nIt receives the environment, user event, and scene data, then returns updated\ndata, scene output messages, and the updated environment.\n\n","args":["data","userdata","scenemsg"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env () userdata -> Messenger.Base.UserEvent -> data -> ( data, List.List (Messenger.Scene.Scene.SceneOutputMsg scenemsg userdata), Messenger.Base.Env () userdata )"},{"name":"RawSceneView","comment":" Raw scene view type.\n\nIt receives the environment and scene data and returns a renderable.\n\n","args":["userdata","data"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env () userdata -> data -> REGL.Common.Renderable"}],"values":[{"name":"genRawScene","comment":" Generate scene storage from a concrete raw scene.\n","type":"Messenger.Scene.Scene.MConcreteScene data userdata scenemsg -> Messenger.Scene.Scene.SceneStorage userdata scenemsg"},{"name":"initCompose","comment":" Compose prototype init with level init.\n","type":"Messenger.Scene.RawScene.RawSceneProtoInit data userdata idata -> Messenger.Scene.RawScene.RawSceneProtoLevelInit userdata scenemsg idata -> Messenger.Base.Runtime -> Messenger.Base.Env () userdata -> Maybe.Maybe scenemsg -> data"}],"binops":[]},{"name":"Messenger.Scene.Scene","comment":"\n\n\n# Scene Base\n\nCore scene types and message types.\n\nMost projects use the type aliases from `Messenger.Scene.RawScene` or\n`Messenger.Scene.LayeredScene`. This module is the lower-level foundation they\nbuild on.\n\n@docs AbstractScene\n@docs MConcreteScene, MAbstractScene\n@docs unroll, abstract\n@docs SceneOutputMsg\n@docs SceneStorage, AllScenes\n@docs MMsg, MMsgBase\n@docs MConcreteGeneralModel, MAbstractGeneralModel\n\n\n## Scene Result Remapper\n\n@docs updateResultRemap\n\n\n## Global Component\n\n@docs GCCommonData, GCBaseData, GCMsg, GCTarget\n@docs AbstractGlobalComponent, ConcreteGlobalComponent\n@docs GlobalComponentInit, GlobalComponentUpdate, GlobalComponentUpdateRec, GlobalComponentView\n@docs GlobalComponentStorage\n\n","unions":[{"name":"AbstractScene","comment":" Rolled abstract scene model.\n\nThis hides the concrete scene data type so scenes with different data can be\nstored in the same scene map.\n\n","args":["envro","env","event","ren","scenemsg","userdata"],"cases":[["Roll",["Messenger.Scene.Scene.UnrolledAbstractScene envro env event ren scenemsg userdata"]]]},{"name":"SceneOutputMsg","comment":" Scene output messages handled by Messenger core.\n\nScenes, layers, components, and global components emit these messages when they\nneed top-level effects such as changing scenes, playing audio, loading\nresources, saving global data, or managing global components.\n\n  - `SOMChangeScene initMsg name` changes to a scene by name.\n  - `SOMAlert text` sends an alert command through user ports.\n  - `SOMPrompt name title` sends a prompt command. The result comes back as a\n    `Prompt name result` user event.\n  - `SOMPlayAudio channel name option` plays a loaded audio resource.\n  - `SOMStopAudio target` stops matching playing audio.\n  - `SOMTransformAudio target transform` applies an `elm-audio` transform.\n  - `SOMSetVolume volume` changes the global volume.\n  - `SOMSaveGlobalData` calls `globalDataCodec.encode`.\n  - `SOMLoadGC gc` loads a global component.\n  - `SOMUnloadGC target` unloads matching global components.\n  - `SOMCallGC ( target, msg )` sends a message to a global component.\n  - `SOMChangeFPS interval` changes the REGL update interval.\n  - `SOMLoadResource key resource` loads a resource at runtime. Loaded data is\n    stored in opaque runtime data and can be read through `Messenger.Base`\n    getters.\n\n","args":["scenemsg","userdata"],"cases":[["SOMChangeScene",["Maybe.Maybe scenemsg","String.String"]],["SOMAlert",["String.String"]],["SOMPrompt",["String.String","String.String"]],["SOMPlayAudio",["Basics.Int","String.String","Messenger.Audio.Base.AudioOption"]],["SOMStopAudio",["Messenger.Audio.Base.AudioTarget"]],["SOMTransformAudio",["Messenger.Audio.Base.AudioTarget","Audio.Audio -> Audio.Audio"]],["SOMSetVolume",["Basics.Float"]],["SOMSaveGlobalData",[]],["SOMLoadGC",["Messenger.Scene.Scene.GlobalComponentStorage userdata scenemsg"]],["SOMUnloadGC",["Messenger.Scene.Scene.GCTarget"]],["SOMCallGC",["( Messenger.Scene.Scene.GCTarget, Messenger.Scene.Scene.GCMsg )"]],["SOMChangeFPS",["REGL.TimeInterval"]],["SOMLoadResource",["String.String","Messenger.Resources.Base.ResourceDef"]]]}],"aliases":[{"name":"AbstractGlobalComponent","comment":" Abstract global component model.\n\nThe concrete data type is hidden after initialization.\n\n","args":["userdata","scenemsg"],"type":"Messenger.Scene.Scene.MAbstractGeneralModel (Messenger.Scene.Scene.GCCommonData userdata scenemsg) userdata Messenger.Scene.Scene.GCTarget Messenger.Scene.Scene.GCMsg Messenger.Scene.Scene.GCBaseData scenemsg"},{"name":"AllScenes","comment":" A dictionary of scene names to scene storage.\n","args":["userdata","scenemsg"],"type":"Dict.Dict String.String (Messenger.Scene.Scene.SceneStorage userdata scenemsg)"},{"name":"ConcreteGlobalComponent","comment":" Concrete global component model.\n","args":["data","userdata","scenemsg"],"type":"{ init : Messenger.Scene.Scene.GlobalComponentInit userdata scenemsg data, update : Messenger.Scene.Scene.GlobalComponentUpdate userdata scenemsg data, updaterec : Messenger.Scene.Scene.GlobalComponentUpdateRec userdata scenemsg data, view : Messenger.Scene.Scene.GlobalComponentView userdata scenemsg data, id : Messenger.Scene.Scene.GCTarget }"},{"name":"GCBaseData","comment":" Base data shared by all global components.\n\n`dead` marks a component for removal. `postProcessor` transforms the scene\nrenderable after the scene view is produced.\n\n","args":[],"type":"{ dead : Basics.Bool, postProcessor : REGL.Common.Renderable -> REGL.Common.Renderable }"},{"name":"GCCommonData","comment":" Common data passed to global components.\n\nIt is the currently running scene, so global components can render or update in\nrelation to the active scene when needed.\n\n","args":["userdata","scenemsg"],"type":"Messenger.Scene.Scene.MAbstractScene userdata scenemsg"},{"name":"GCMsg","comment":" Global component message type.\n\nJSON values are used so global components can be addressed dynamically.\n\n","args":[],"type":"Json.Decode.Value"},{"name":"GCTarget","comment":" Global component target type.\n","args":[],"type":"String.String"},{"name":"GlobalComponentInit","comment":" Global component init type.\n","args":["userdata","scenemsg","data"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env (Messenger.Scene.Scene.GCCommonData userdata scenemsg) userdata -> Messenger.Scene.Scene.GCMsg -> ( data, Messenger.Scene.Scene.GCBaseData )"},{"name":"GlobalComponentStorage","comment":" Global component storage.\n\nThis is what gets loaded by `SOMLoadGC` or startup global component lists.\n\n","args":["userdata","scenemsg"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env (Messenger.Scene.Scene.GCCommonData userdata scenemsg) userdata -> Messenger.Scene.Scene.AbstractGlobalComponent userdata scenemsg"},{"name":"GlobalComponentUpdate","comment":" Global component update type.\n\nThe returned boolean is the block flag. If it is `True`, the current user event\nwill not be passed to later global components or the scene.\n\n","args":["userdata","scenemsg","data"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env (Messenger.Scene.Scene.GCCommonData userdata scenemsg) userdata -> Messenger.Base.UserEvent -> data -> Messenger.Scene.Scene.GCBaseData -> ( ( data, Messenger.Scene.Scene.GCBaseData ), List.List (Messenger.Scene.Scene.MMsg Messenger.Scene.Scene.GCTarget Messenger.Scene.Scene.GCMsg scenemsg userdata), ( Messenger.Base.Env (Messenger.Scene.Scene.GCCommonData userdata scenemsg) userdata, Basics.Bool ) )"},{"name":"GlobalComponentUpdateRec","comment":" Global component recursive update type.\n\nThis handles messages sent to the global component by target.\n\n","args":["userdata","scenemsg","data"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env (Messenger.Scene.Scene.GCCommonData userdata scenemsg) userdata -> Messenger.Scene.Scene.GCMsg -> data -> Messenger.Scene.Scene.GCBaseData -> ( ( data, Messenger.Scene.Scene.GCBaseData ), List.List (Messenger.Scene.Scene.MMsg Messenger.Scene.Scene.GCTarget Messenger.Scene.Scene.GCMsg scenemsg userdata), Messenger.Base.Env (Messenger.Scene.Scene.GCCommonData userdata scenemsg) userdata )"},{"name":"GlobalComponentView","comment":" Global component view type.\n","args":["userdata","scenemsg","data"],"type":"Messenger.Base.Runtime -> Messenger.Base.Env (Messenger.Scene.Scene.GCCommonData userdata scenemsg) userdata -> data -> Messenger.Scene.Scene.GCBaseData -> REGL.Common.Renderable"},{"name":"MAbstractGeneralModel","comment":" Specialized abstract general model for Messenger scenes, layers, and components.\n","args":["common","userdata","tar","msg","bdata","scenemsg"],"type":"Messenger.GeneralModel.AbstractGeneralModel Messenger.Base.Runtime (Messenger.Base.Env common userdata) Messenger.Base.UserEvent tar msg REGL.Common.Renderable bdata (Messenger.Scene.Scene.SceneOutputMsg scenemsg userdata)"},{"name":"MAbstractScene","comment":" Specialized abstract scene for Messenger.\n","args":["userdata","scenemsg"],"type":"Messenger.Scene.Scene.AbstractScene Messenger.Base.Runtime (Messenger.Base.Env () userdata) Messenger.Base.UserEvent REGL.Common.Renderable scenemsg userdata"},{"name":"MConcreteGeneralModel","comment":" Specialized concrete general model for Messenger scenes, layers, and components.\n","args":["data","common","userdata","tar","msg","bdata","scenemsg"],"type":"Messenger.GeneralModel.ConcreteGeneralModel data Messenger.Base.Runtime (Messenger.Base.Env common userdata) Messenger.Base.UserEvent tar msg REGL.Common.Renderable bdata (Messenger.Scene.Scene.SceneOutputMsg scenemsg userdata)"},{"name":"MConcreteScene","comment":" Specialized concrete scene for Messenger.\n","args":["data","userdata","scenemsg"],"type":"Messenger.Scene.Scene.ConcreteScene data Messenger.Base.Runtime (Messenger.Base.Env () userdata) Messenger.Base.UserEvent REGL.Common.Renderable scenemsg userdata"},{"name":"MMsg","comment":" Messenger message.\n\nThis specializes `Messenger.GeneralModel.Msg` with `SceneOutputMsg` as the\nparent/system message type.\n\n","args":["othertar","msg","scenemsg","userdata"],"type":"Messenger.GeneralModel.Msg othertar msg (Messenger.Scene.Scene.SceneOutputMsg scenemsg userdata)"},{"name":"MMsgBase","comment":" Messenger message base.\n\nThis specializes `Messenger.GeneralModel.MsgBase` with `SceneOutputMsg` as the\nparent/system message type.\n\n","args":["othermsg","scenemsg","userdata"],"type":"Messenger.GeneralModel.MsgBase othermsg (Messenger.Scene.Scene.SceneOutputMsg scenemsg userdata)"},{"name":"SceneStorage","comment":" Scene storage.\n\nA `SceneStorage` is what goes into the `AllScenes` dictionary. It receives an\noptional scene message and the current environment, then returns an initialized\nabstract scene.\n\n","args":["userdata","scenemsg"],"type":"Maybe.Maybe scenemsg -> Messenger.Base.Runtime -> Messenger.Base.Env () userdata -> Messenger.Scene.Scene.MAbstractScene userdata scenemsg"}],"values":[{"name":"abstract","comment":" Abstract a concrete scene.\n\nThe concrete scene is initialized immediately with the given message and\nenvironment. The resulting `AbstractScene` stores its data privately.\n\n","type":"Messenger.Scene.Scene.ConcreteScene data envro env event ren scenemsg userdata -> Maybe.Maybe scenemsg -> envro -> env -> Messenger.Scene.Scene.AbstractScene envro env event ren scenemsg userdata"},{"name":"unroll","comment":" Unroll an abstract scene.\n\nThis is useful when advanced code needs to manually update or view an abstract\nscene, for example in `Messenger.Scene.VSR`.\n\n","type":"Messenger.Scene.Scene.AbstractScene envro env event ren scenemsg userdata -> Messenger.Scene.Scene.UnrolledAbstractScene envro env event ren scenemsg userdata"},{"name":"updateResultRemap","comment":" Remap the result of an abstract scene update.\n\nUse this when wrapping a scene and transforming its emitted `SceneOutputMsg`s or\nenvironment.\n\n","type":"(( List.List (Messenger.Scene.Scene.SceneOutputMsg scenemsg userdata), env ) -> ( List.List (Messenger.Scene.Scene.SceneOutputMsg scenemsg userdata), env )) -> Messenger.Scene.Scene.AbstractScene envro env event ren scenemsg userdata -> Messenger.Scene.Scene.AbstractScene envro env event ren scenemsg userdata"}],"binops":[]},{"name":"Messenger.Scene.VSR","comment":"\n\n\n# Virtual Scene Runner\n\nRun a scene as data inside another object, usually a global component. This is\nused by transitions and stacked scenes where the previous scene must continue to\nrender or update while another scene is active.\n\n@docs VSR\n@docs updateVSR, viewVSR\n\n","unions":[],"aliases":[{"name":"VSR","comment":" Virtual scene runner state.\n\nIt stores the virtual scene's environment and the abstract scene value.\n\n","args":["userdata","scenemsg"],"type":"{ env : Messenger.Base.Env () userdata, runtime : Messenger.Base.Runtime, scene : Messenger.Scene.Scene.MAbstractScene userdata scenemsg }"}],"values":[{"name":"updateVSR","comment":" Update the virtual scene runner with a user event.\n\n`Tick` also advances the virtual scene's internal time counters, mirroring how\nthe main Messenger model updates scene time.\n\n","type":"Messenger.Scene.VSR.VSR userdata scenemsg -> Messenger.Base.UserEvent -> ( Messenger.Scene.VSR.VSR userdata scenemsg, List.List (Messenger.Scene.Scene.SceneOutputMsg scenemsg userdata) )"},{"name":"viewVSR","comment":" Render the virtual scene.\n","type":"Messenger.Scene.VSR.VSR userdata scenemsg -> REGL.Common.Renderable"}],"binops":[]},{"name":"Messenger.UI","comment":"\n\n\n# User Interface\n\nTop-level user interface to the Messenger engine.\n\n@docs Output\n@docs genMain\n\n","unions":[],"aliases":[{"name":"Output","comment":" The Elm program type generated by Messenger.\n\nThe model is wrapped by `elm-audio` so Messenger can manage audio and normal\nElm commands together.\n\n","args":["userdata","scenemsg"],"type":"Platform.Program Messenger.Base.Flags (Audio.Model Messenger.Internal.WorldEvent (Messenger.Model.Model userdata scenemsg)) (Audio.Msg Messenger.Internal.WorldEvent)"}],"values":[{"name":"genMain","comment":" Generate the main program from Messenger input.\n\nUse this for your `main` function in generated projects.\n\n","type":"Messenger.UI.Input.Input userdata scenemsg -> Messenger.UI.Output userdata scenemsg"}],"binops":[]},{"name":"Messenger.UI.Input","comment":"\n\n\n# Input to the Messenger UI\n\nThe generated `Main.elm` collects user configuration, resources, scenes, and\nstartup global components into this record before calling `Messenger.UI.genMain`.\n\n@docs Input\n\n","unions":[],"aliases":[{"name":"Input","comment":" The input required to start a Messenger program.\n\n  - `config` contains ports and runtime settings.\n  - `resources` are loaded before normal updates begin.\n  - `scenes` maps scene names to scene storage.\n  - `globalComponents` are loaded at startup.\n\n","args":["userdata","scenemsg"],"type":"{ config : Messenger.UserConfig.UserConfig userdata scenemsg, resources : Messenger.Resources.Base.ResourceDefs, scenes : Messenger.Scene.Scene.AllScenes userdata scenemsg, globalComponents : List.List (Messenger.Scene.Scene.GlobalComponentStorage userdata scenemsg) }"}],"values":[],"binops":[]},{"name":"Messenger.UserConfig","comment":"\n\n\n# User Configuration\n\nConfiguration and port definitions used to start a Messenger program. Generated\nprojects usually fill this record from `MainConfig.elm` and `Lib.Ports`.\n\n@docs UserConfig, PortDefs\n@docs EnabledBuiltinProgram\n\n","unions":[{"name":"EnabledBuiltinProgram","comment":" Built-in REGL programs enabled at startup.\n\n  - `NoBuiltinProgram` represents enabling no builtin program\n  - `CustomBuiltinProgramList` represents enabling a list of custom builtin programs\n  - `TextOnlyBuiltinProgram` represents enabling the builtin program for text only\n  - `BasicShapesBuiltinProgram` represents enabling the builtin programs for basic shapes\n  - `CommonBuiltinProgram` represents enabling the builtin programs for common shapes\n  - `AllBuiltinProgram` represents enabling all builtin programs (Recommended)\n\n","args":[],"cases":[["NoBuiltinProgram",[]],["CustomBuiltinProgramList",["List.List String.String"]],["TextOnlyBuiltinProgram",[]],["BasicShapesBuiltinProgram",[]],["AllBuiltinProgram",[]]]}],"aliases":[{"name":"PortDefs","comment":" Ports required by Messenger.\n\nGenerated projects define these ports in `Lib.Ports`. Messenger uses them for\nlocal storage, prompts, alerts, REGL commands, data-file loading, and audio\ninterop.\n\n**Learn more about ports [here](https://guide.elm-lang.org/interop/ports)**\n\n","args":[],"type":"{ sendInfo : String.String -> Platform.Cmd.Cmd Messenger.Internal.WorldEvent, audioPortToJS : Json.Encode.Value -> Platform.Cmd.Cmd (Audio.Msg Messenger.Internal.WorldEvent), audioPortFromJS : (Json.Decode.Value -> Audio.Msg Messenger.Internal.WorldEvent) -> Platform.Sub.Sub (Audio.Msg Messenger.Internal.WorldEvent), alert : String.String -> Platform.Cmd.Cmd Messenger.Internal.WorldEvent, prompt : { name : String.String, title : String.String } -> Platform.Cmd.Cmd Messenger.Internal.WorldEvent, promptReceiver : ({ name : String.String, result : String.String } -> Messenger.Internal.WorldEvent) -> Platform.Sub.Sub Messenger.Internal.WorldEvent, reglupdate : (Basics.Float -> Messenger.Internal.WorldEvent) -> Platform.Sub.Sub Messenger.Internal.WorldEvent, setView : Json.Encode.Value -> Platform.Cmd.Cmd Messenger.Internal.WorldEvent, execREGLCmd : Json.Encode.Value -> Platform.Cmd.Cmd Messenger.Internal.WorldEvent, recvREGLCmd : (Json.Encode.Value -> Messenger.Internal.WorldEvent) -> Platform.Sub.Sub Messenger.Internal.WorldEvent, loadDataFile : { name : String.String, path : String.String } -> Platform.Cmd.Cmd Messenger.Internal.WorldEvent, dataFileLoaded : ({ name : String.String, data : String.String } -> Messenger.Internal.WorldEvent) -> Platform.Sub.Sub Messenger.Internal.WorldEvent }"},{"name":"UserConfig","comment":" User configuration for Messenger.\n\n`userdata` is a custom type which can store any data in the game.\nusers can **save their own global data** and **implement local storage** here.\n\n`scenemsg` is another custom type which represents the message type users wants\nto send to a scene when switching scenes.\n\n  - `initScene` represents the scene users get start\n  - `initSceneMsg` represents the message to initialize the start scene\n  - `globalDataCodec` is for local storage. Users decode saved data into\n    `GlobalDataInit`, and encode the current `Runtime` and `GlobalData` when saving.\n  - `virtualSize` represents how users want their game be virtual sized. In other words,\n    users make their game in the virtual size, and the game will be resized due to the browser window size\n    but keeping the aspect ratio\n  - `debug` option determines whether enable some simple debugging tools or not\n    remember to disable it when releasing game\n  - `timeInterval` See `TimeInterval`\n  - `ports` stores the ports that users must provide.\n\n","args":["userdata","scenemsg"],"type":"{ initScene : String.String, initSceneMsg : Maybe.Maybe scenemsg, globalDataCodec : { encode : Messenger.Base.Runtime -> Messenger.Base.GlobalData userdata -> String.String, decode : String.String -> Messenger.Base.GlobalDataInit userdata }, virtualSize : { width : Basics.Float, height : Basics.Float }, debug : Basics.Bool, timeInterval : REGL.TimeInterval, ports : Messenger.UserConfig.PortDefs, enabledProgram : Messenger.UserConfig.EnabledBuiltinProgram, fboNum : Basics.Int }"}],"values":[],"binops":[]}]