[{"name":"Gamepad","comment":" The Gamepad module exposes a type that lets you classify gamepads.\n\n\n# Common gamepad\n\n@docs Gamepad, decoder, connected\n\n\n## Debugging values\n\nThis library aims to offer you all the functions you need.\nIf it somehow doesn't, however, you may use the following functions to find what you need.\n\n@docs buttons, joysticks, getButton, getJoystick\n\n","unions":[],"aliases":[{"name":"Gamepad","comment":" The Gamepad type represents a player's game controller.\nEvery gamepad type is a separate device that is handled by a different player.\n","args":[],"type":"Internal.Gamepad.Gamepad"}],"values":[{"name":"buttons","comment":" Gets all available buttons on the controller as one list of buttons.\n","type":"Gamepad.Gamepad -> List.List Internal.Button.Button"},{"name":"connected","comment":" Whether the gamepad is currently connected.\n","type":"Gamepad.Gamepad -> Basics.Bool"},{"name":"decoder","comment":" This decoder directly takes a JSON value and decodes it into a list of gamepads.\n","type":"Json.Decode.Decoder (List.List Gamepad.Gamepad)"},{"name":"getButton","comment":" Get a given button at a specific location in the array of buttons.\n\nIf the button doesn't exist, the function returns a fake button that is never pressed.\n\n","type":"Basics.Int -> Gamepad.Gamepad -> Internal.Button.Button"},{"name":"getJoystick","comment":" Get a given joystick at a specific location in the array of joysticks.\n\nIf the joystick doesn't exist, the function returns a fake joystick that is never pressed.\n\n","type":"Basics.Int -> Gamepad.Gamepad -> Internal.Joystick.Joystick"},{"name":"joysticks","comment":" Gets all available joysticks on the controller as one list of joysticks.\n","type":"Gamepad.Gamepad -> List.List Internal.Joystick.Joystick"}],"binops":[]},{"name":"Gamepad.Button","comment":" This module represents buttons on a game controller.\n\n\n# Button type\n\n@docs Button, pressed, touched, value\n\n\n# Button index\n\nThis library looks at what your controller looks like, and indexes each button for you.\nThis way, you can simply check if any button is being pressed.\n\n\n## A, B, X, Y buttons\n\nDifferent controllers use different letters (A, B, X, Y or X, O, square and triangle) in different configurations\n\n  - which can get very confusing! That's why this library doesn't bother with the exact letters,\n    and simply labels them as **primary**, **secondary**, **tertiary** and **quaternary**.\n    The library will automatically link them to the relevant buttons for each controller.\n\n@docs primary, secondary, tertiary, quaternary\n\n\n## Directional buttons\n\nMost controllers have a bunch of directional buttons that can be used for a directional menu.\nUsually, these are used for things like quick slots from a player's inventory.\n\n@docs up, left, right, down\n\n\n## Buttons on the front\n\nWhether you call it the top or the front of the controllers,\nthere's always a few buttons up there.\n\n@docs leftBumper, rightBumper, leftTrigger, rightTrigger\n\n\n## Joystick buttons\n\nSome joystick buttons allow you to press on them. As a result, you will hear a soft clicking noise.\nThese buttons are usually used for actions that should be executed very rarely,\nlike switching camera perspective, as not all controllers have these buttons.\n\n@docs leftStick, rightStick\n\n\n## Menu buttons\n\nThe menu buttons are usually used to pause games, open in-game (or out-of-game) menus,\nand change settings.\n\n@docs start, select, home, touchpad\n\n\n## A,B,X,Y in order\n\nIn some rare cases, you do not care about the actual buttons and you just want them in their directions.\nIn that case, you can access the right button by their orientation.\nNote that these buttons will likely overlap with the [`primary`](Gamepad.Button#primary), [`secondary`](Gamepad.Button#secondary), [`tertiary`](Gamepad.Button#tertiary) and [`quaternary`](Gamepad.Button#quaternary) buttons.\n\n@docs north, east, south, west\n\n","unions":[],"aliases":[{"name":"Button","comment":" The most common type on any controller. Most buttons can only be pressed and released,\nbut some are a little bit more advanced.\n","args":[],"type":"Internal.Button.Button"}],"values":[{"name":"down","comment":" The down arrow button.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"east","comment":" Button in the east position.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"home","comment":" The home button is an unpredictable one, for some programs might interpret the button beyond your control.\nThe button usually serves as a method of turning a controller on/off, or changing the state of the game.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"left","comment":" The left arrow button.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"leftBumper","comment":" The small button on the left front of the game controller.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"leftStick","comment":" Button by pressing down the left joystick.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"leftTrigger","comment":" The large button on the left front of the game controller.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"north","comment":" Button in the north position.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"pressed","comment":" Most buttons are a simple press/don't press switch.\nThis value lets you know whether the button is being pressed.\n","type":"Gamepad.Button.Button -> Basics.Bool"},{"name":"primary","comment":" The primary and most important button on the controller.\nThis button is used for actions like:\n\n  - Jumping in a platformer\n  - Pressing \"OK\" in menus\n  - Serving as a \"click\" button to confirm actions\n\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"quaternary","comment":" The fourth button is the least accessible button and should effectively be used the least.\nThis button is used for actions like:\n\n  - Opening a quick menu\n  - Opening a settings menu\n  - Activating a rare ability with a long cooldown\n\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"right","comment":" The right arrow button.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"rightBumper","comment":" The small button on the right front of the game controller.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"rightStick","comment":" Button by pressing down the right joystick.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"rightTrigger","comment":" The large button on the right front of the game controller.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"secondary","comment":" The secondary button is the secondary button that is second-most important.\nFor some controllers, it can be used as an complementing button to the primary button.\nThis button is used for actions like:\n\n  - Using a special action in a platformer\n  - Pressing \"CANCEL\" in menus\n  - Serving as a cancel button to reverse actions\n\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"select","comment":" The select button usually serves as an in-game button to interrupt a game and open an in-game menu.\nFor example, users might open their inventory this way, or look at a map of their surroundings.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"south","comment":" Button in the south position.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"start","comment":" The start button usually serves as a pause button to interrupt a game and open a menu.\nHere, players can alter settings, change the window, or leave a game.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"tertiary","comment":" The tertiary button is the button that is used rather infrequently,\nbut is still placed near the player's finger because the action is still used quite frequently.\nThis button is used for actions like:\n\n  - Reloading in a shooter game\n  - Using a special ability in a platformer\n  - Hiding in a stealth game\n\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"touched","comment":" Some buttons notice if they're being touched by the user,\noften through the use of a touchscreen. Effectively,\nsome buttons let you see whether the user touches the button without pressing it.\n\nKeep in mind that most controllers also set this value to true when the button\nis being pressed.\n\n","type":"Gamepad.Button.Button -> Basics.Bool"},{"name":"touchpad","comment":" The touchpad button is a button that doesn't exist on most controllers.\nIt is often used for controlling the mouse, but it can also be used as a simple button.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"up","comment":" The up arrow button.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"},{"name":"value","comment":" Some buttons notice how firmly they're being pressed.\n\nIf the button supports this, this value shows how firmly, on a scale from 0 to 1.\nIf the button doesn't support this, the value will always be 0 (when not pressed) or 1 (when pressed).\n\n","type":"Gamepad.Button.Button -> Basics.Float"},{"name":"west","comment":" Button in the west position.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Button.Button"}],"binops":[]},{"name":"Gamepad.Joystick","comment":" This module is about showing joysticks.\n\n@docs Joystick, left, right\n\nIf you suspect that your user might somehow have more than two joysticks,\nyou can access them using the general [Gamepad#joysticks] function.\n\n\n## Reading joysticks\n\nThe joystick's value can be read in multiple ways that might suit your needs.\n\n@docs abs, direction, directionRad, toXY\n\n","unions":[],"aliases":[{"name":"Joystick","comment":" A joystick is a representation of a stick that can move in all directions.\n","args":[],"type":"Internal.Joystick.Joystick"}],"values":[{"name":"abs","comment":" On a scale from 0 to 1, return how intensely the joystick is being pushed away from the center.\n\nThis **should** be zero when the user doesn't touch their joystick,\nbut that's often not the case. Joysticks get less accurate as the controller\ngrows old, so you should expect this value to be near-zero rather than\nprecisely zero.\n\n","type":"Gamepad.Joystick.Joystick -> Basics.Float"},{"name":"direction","comment":" Starting from the top, get a direction in terms of degress,\nstarting at 0 from the top and going to 360 clockwise.\n","type":"Gamepad.Joystick.Joystick -> Basics.Int"},{"name":"directionRad","comment":" Same as direction, except the value is now a number between 0 and 1.\n","type":"Gamepad.Joystick.Joystick -> Basics.Float"},{"name":"left","comment":" Get the joystick that usually resides on the left of the controller.\nThis is considered the primary joystick on the controller.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Joystick.Joystick"},{"name":"right","comment":" Get the joystick that usually resides on the right of the controller.\nThis is considered the secondary joystick on the controller.\n","type":"Internal.Gamepad.Gamepad -> Gamepad.Joystick.Joystick"},{"name":"toXY","comment":" Convert a joystick's direction to an x and y value.\nThe coordinates are defined as is starting from the top left, so:\n\n  - Top means negative y\n  - Left means negative x\n  - Right means positive x\n  - Bottom means positive y\n\nBoth values go from -1 to 1, so (-1, -1) and (1, 1) are the top left and bottom right respectively.\n\n","type":"Gamepad.Joystick.Joystick -> { x : Basics.Float, y : Basics.Float }"}],"binops":[]}]