[{"name":"Playground3D","comment":" Contains most of the usual suspects from elm-playground, just 3D-ified.\n\n@docs withCamera\n@docs withLighting\n@docs withShadow\n@docs Scene\n@docs Shape\n@docs yellow\n@docs black\n@docs blue\n@docs box\n@docs brown\n@docs charcoal\n@docs darkBlue\n@docs darkBrown\n@docs darkCharcoal\n@docs darkGray\n@docs darkGreen\n@docs darkGrey\n@docs darkOrange\n@docs darkPurple\n@docs darkRed\n@docs darkYellow\n@docs fromColor\n@docs group\n@docs lightBlue\n@docs lightBrown\n@docs lightCharcoal\n@docs lightGray\n@docs lightGreen\n@docs lightGrey\n@docs lightOrange\n@docs lightPurple\n@docs lightRed\n@docs lightYellow\n@docs Lighting\n@docs move\n@docs moveBack\n@docs moveDown\n@docs moveForward\n@docs moveLeft\n@docs moveRight\n@docs moveUp\n@docs moveX\n@docs moveY\n@docs moveZ\n@docs orange\n@docs purple\n@docs red\n@docs rgb\n@docs rotate\n@docs grey\n@docs gray\n@docs green\n@docs game\n@docs scale\n@docs scene\n@docs white\n@docs Computer\n@docs Keyboard\n@docs Mouse\n@docs Screen\n@docs Time\n@docs Number\n@docs sphere\n@docs toX\n@docs toXY\n@docs toY\n\n","unions":[{"name":"Lighting","comment":" Different types of lighting that the scene can have\n","args":["coordinates"],"cases":[["Unlit",[]],["Sunny",["Direction3d.Direction3d coordinates","Playground3D.CastShadows"]]]},{"name":"Shape","comment":" Shapes help you make a `picture`, `animation`, or `game`.\n\nRead on to see examples of [`circle`](#circle), [`rectangle`](#rectangle),\n[`words`](#words), [`image`](#image), and many more!\n\n","args":[],"cases":[]}],"aliases":[{"name":"Computer","comment":" When writing a [`game`](#game), you can look up all sorts of information\nabout your computer:\n\n  - [`Mouse`](#Mouse) - Where is the mouse right now?\n  - [`Keyboard`](#Keyboard) - Are the arrow keys down?\n  - [`Screen`](#Screen) - How wide is the screen?\n  - [`Time`](#Time) - What time is it right now?\n\nSo you can use expressions like `computer.mouse.x` and `computer.keyboard.enter`\nin games where you want some mouse or keyboard interaction.\n\n","args":[],"type":"{ mouse : Playground3D.Mouse, keyboard : Playground3D.Keyboard, screen : Playground3D.Screen, time : Playground3D.Time }"},{"name":"Keyboard","comment":" Figure out what is going on with the keyboard.\n\nIf someone is pressing the UP and RIGHT arrows, you will see a value like this:\n\n    { up = True\n    , down = False\n    , left = False\n    , right = True\n    , space = False\n    , enter = False\n    , shift = False\n    , backspace = False\n    , keys = Set.fromList [ \"ArrowUp\", \"ArrowRight\" ]\n    }\n\nSo if you want to move a character based on arrows, you could write an update\nlike this:\n\n    update computer y =\n        if computer.keyboard.up then\n            y + 1\n\n        else\n            y\n\nCheck out [`toX`](#toX) and [`toY`](#toY) which make this even easier!\n\n**Note:** The `keys` set will be filled with the name of all keys which are\ndown right now. So you will see things like `\"a\"`, `\"b\"`, `\"c\"`, `\"1\"`, `\"2\"`,\n`\"Space\"`, and `\"Control\"` in there. Check out [this list][list] to see the\nnames used for all the different special keys! From there, you can use\n[`Set.member`][member] to check for whichever key you want. E.g.\n`Set.member \"Control\" computer.keyboard.keys`.\n\n[list]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values\n[member]: /packages/elm/core/latest/Set#member\n\n","args":[],"type":"{ up : Basics.Bool, down : Basics.Bool, left : Basics.Bool, right : Basics.Bool, space : Basics.Bool, enter : Basics.Bool, shift : Basics.Bool, backspace : Basics.Bool, keys : Set.Set String.String }"},{"name":"Mouse","comment":" Information about the mouse\n","args":[],"type":"{ x : Playground3D.Number, y : Playground3D.Number, down : Basics.Bool, click : Basics.Bool }"},{"name":"Number","comment":" A number like `1` or `3.14` or `-120`.\n","args":[],"type":"Basics.Float"},{"name":"Scene","comment":" A scene is a collection of shapes, camera, lighting, and background\n","args":["coordinates"],"type":"{ camera : Camera3d.Camera3d Length.Meters coordinates, clipDepth : Length.Length, background : Scene3d.Background coordinates, shapes : List.List Playground3D.Shape, lighting : Playground3D.Lighting coordinates }"},{"name":"Screen","comment":" Get the dimensions of the screen. If the screen is 800 by 600, you will see\na value like this:\n\n    { width = 800\n    , height = 600\n    , top = 300\n    , left = -400\n    , right = 400\n    , bottom = -300\n    }\n\nThis can be nice when used with [`moveY`](#moveY) if you want to put something\non the bottom of the screen, no matter the dimensions.\n\n","args":[],"type":"{ width : Playground3D.Number, height : Playground3D.Number, top : Playground3D.Number, left : Playground3D.Number, right : Playground3D.Number, bottom : Playground3D.Number }"},{"name":"Time","comment":" The current time.\n\nHelpful when making an [`animation`](#animation) with functions like\n[`spin`](#spin), [`wave`](#wave), and [`zigzag`](#zigzag).\n\n","args":[],"type":"Time.Posix"}],"values":[{"name":"black","comment":" The color black\n","type":"Playground3D.Color"},{"name":"blue","comment":" The color blue\n","type":"Playground3D.Color"},{"name":"box","comment":" Create a box, like a cube or other shape\n","type":"Playground3D.Color -> Playground3D.Number -> Playground3D.Number -> Playground3D.Number -> Playground3D.Shape"},{"name":"brown","comment":" The color brown\n","type":"Playground3D.Color"},{"name":"charcoal","comment":" The color charcoal\n","type":"Playground3D.Color"},{"name":"darkBlue","comment":" The color dark blue\n","type":"Playground3D.Color"},{"name":"darkBrown","comment":" The color dark brown\n","type":"Playground3D.Color"},{"name":"darkCharcoal","comment":" The color darkCharcoal\n","type":"Playground3D.Color"},{"name":"darkGray","comment":" ","type":"Playground3D.Color"},{"name":"darkGreen","comment":" The color dark green\n","type":"Playground3D.Color"},{"name":"darkGrey","comment":" The color dark grey\n","type":"Playground3D.Color"},{"name":"darkOrange","comment":" The color dark orange\n","type":"Playground3D.Color"},{"name":"darkPurple","comment":" The color dark purple\n","type":"Playground3D.Color"},{"name":"darkRed","comment":" The color dark red\n","type":"Playground3D.Color"},{"name":"darkYellow","comment":" The color dark yellow\n","type":"Playground3D.Color"},{"name":"fromColor","comment":" Create a material from a color, that can be applied to a shape\n","type":"Playground3D.Color -> Scene3d.Material.Material coordinates { attributes | normals : () }"},{"name":"game","comment":" Create a game!\n\nOnce you get comfortable with [`animation`](#animation), you can try making a\ngame with the keyboard and mouse. Here is an example of a green square that\njust moves to the right:\n\n    import Playground exposing (..)\n\n    main =\n        game view update 0\n\n    view computer offset =\n        [ square green 40\n            |> moveRight offset\n        ]\n\n    update computer offset =\n        offset + 0.03\n\nThis shows the three important parts of a game:\n\n1.  `memory` - makes it possible to store information. So with our green square,\n    we save the `offset` in memory. It starts out at `0`.\n2.  `view` - lets us say which shapes to put on screen. So here we move our\n    square right by the `offset` saved in memory.\n3.  `update` - lets us update the memory. We are incrementing the `offset` by\n    a tiny amount on each frame.\n\nThe `update` function is called about 60 times per second, so our little\nchanges to `offset` start to add up pretty quickly!\n\nThis game is not very fun though! Making a `game` also gives you access to the\n[`Computer`](#Computer), so you can use information about the [`Mouse`](#Mouse)\nand [`Keyboard`](#Keyboard) to make it interactive! So here is a red square that\nmoves based on the arrow keys:\n\n    import Playground exposing (..)\n\n    main =\n        game view update ( 0, 0 )\n\n    view computer ( x, y ) =\n        [ square red 40\n            |> move x y\n        ]\n\n    update computer ( x, y ) =\n        ( x + toX computer.keyboard\n        , y + toY computer.keyboard\n        )\n\nNotice that in the `update` we use information from the keyboard to update the\n`x` and `y` values. These building blocks let you make pretty fancy games!\n\n","type":"(Playground3D.Computer -> memory -> Playground3D.Scene coordinates) -> (Playground3D.Computer -> memory -> memory) -> memory -> Platform.Program () (Playground3D.Game memory) Playground3D.Msg"},{"name":"gray","comment":" ","type":"Playground3D.Color"},{"name":"green","comment":" The color green\n","type":"Playground3D.Color"},{"name":"grey","comment":" The color grey\n","type":"Playground3D.Color"},{"name":"group","comment":" Group shapes together.\n\n    import Playground3D exposing (..)\n\n    main =\n        picture\n            [ group [ sphere red 10, sphere blue 10 ] ]\n\n","type":"List.List Playground3D.Shape -> Playground3D.Shape"},{"name":"lightBlue","comment":" The color light blue\n","type":"Playground3D.Color"},{"name":"lightBrown","comment":" The color light brown\n","type":"Playground3D.Color"},{"name":"lightCharcoal","comment":" The color light charcoal\n","type":"Playground3D.Color"},{"name":"lightGray","comment":" ","type":"Playground3D.Color"},{"name":"lightGreen","comment":" The color light green\n","type":"Playground3D.Color"},{"name":"lightGrey","comment":" The color light grey\n","type":"Playground3D.Color"},{"name":"lightOrange","comment":" The color light orange\n","type":"Playground3D.Color"},{"name":"lightPurple","comment":" The color light purple\n","type":"Playground3D.Color"},{"name":"lightRed","comment":" The color light red\n","type":"Playground3D.Color"},{"name":"lightYellow","comment":" The color light yellow\n","type":"Playground3D.Color"},{"name":"move","comment":" Move a shape in one or more directions\n","type":"Playground3D.Number -> Playground3D.Number -> Playground3D.Number -> Playground3D.Shape -> Playground3D.Shape"},{"name":"moveBack","comment":" Move a shape back\n","type":"Playground3D.Number -> Playground3D.Shape -> Playground3D.Shape"},{"name":"moveDown","comment":" Move a shape down\n","type":"Playground3D.Number -> Playground3D.Shape -> Playground3D.Shape"},{"name":"moveForward","comment":" Move a shape forward\n","type":"Playground3D.Number -> Playground3D.Shape -> Playground3D.Shape"},{"name":"moveLeft","comment":" Move a shape left\n","type":"Playground3D.Number -> Playground3D.Shape -> Playground3D.Shape"},{"name":"moveRight","comment":" Move a shape right\n","type":"Playground3D.Number -> Playground3D.Shape -> Playground3D.Shape"},{"name":"moveUp","comment":" Move a shape up\n","type":"Playground3D.Number -> Playground3D.Shape -> Playground3D.Shape"},{"name":"moveX","comment":" Move a shape left or right\n","type":"Playground3D.Number -> Playground3D.Shape -> Playground3D.Shape"},{"name":"moveY","comment":" Move a shape up or down\n","type":"Playground3D.Number -> Playground3D.Shape -> Playground3D.Shape"},{"name":"moveZ","comment":" Move a shape forward or backward\n","type":"Playground3D.Number -> Playground3D.Shape -> Playground3D.Shape"},{"name":"orange","comment":" The color orange\n","type":"Playground3D.Color"},{"name":"purple","comment":" The color purple\n","type":"Playground3D.Color"},{"name":"red","comment":" The color red\n","type":"Playground3D.Color"},{"name":"rgb","comment":" RGB stands for Red-Green-Blue. With these three parts, you can create any\ncolor you want. For example:\n\n    brightBlue =\n        rgb 18 147 216\n\n    brightGreen =\n        rgb 119 244 8\n\n    brightPurple =\n        rgb 94 28 221\n\nEach number needs to be between 0 and 255.\n\nIt can be hard to figure out what numbers to pick, so try using a color picker\nlike [paletton] to find colors that look nice together. Once you find nice\ncolors, click on the color previews to get their RGB values.\n\n[paletton]: http://paletton.com/\n\n","type":"Playground3D.Number -> Playground3D.Number -> Playground3D.Number -> Playground3D.Color"},{"name":"rotate","comment":" Rotate shapes in degrees.\n\n    import Playground exposing (..)\n\n    main =\n        picture\n            [ words black \"These words are tilted!\"\n                |> rotate 10\n            ]\n\nThe degrees go **counter-clockwise** to match the direction of the\n[unit circle](https://en.wikipedia.org/wiki/Unit_circle).\n\n","type":"Playground3D.Number -> Playground3D.Shape -> Playground3D.Shape"},{"name":"scale","comment":" Scale a shape\n","type":"Playground3D.Number -> Playground3D.Shape -> Playground3D.Shape"},{"name":"scene","comment":" Create a scene by giving it some shapes. Using other functions, you can set the camera and lighting.\n","type":"List.List Playground3D.Shape -> Playground3D.Scene coordinates"},{"name":"sphere","comment":" Create a sphere\n","type":"Playground3D.Color -> Playground3D.Number -> Playground3D.Shape"},{"name":"toX","comment":" Turn the LEFT and RIGHT arrows into a number.\n\n    toX { left = False, right = False, ... } == 0\n    toX { left = True , right = False, ... } == -1\n    toX { left = False, right = True , ... } == 1\n    toX { left = True , right = True , ... } == 0\n\nSo to make a square move left and right based on the arrow keys, we could say:\n\n    import Playground exposing (..)\n\n    main =\n        game view update 0\n\n    view computer x =\n        [ square green 40\n            |> moveX x\n        ]\n\n    update computer x =\n        x + toX computer.keyboard\n\n","type":"Playground3D.Keyboard -> Playground3D.Number"},{"name":"toXY","comment":" If you just use `toX` and `toY`, you will move diagonal too fast. You will go\nright at 1 pixel per update, but you will go up/right at 1.41421 pixels per\nupdate.\n\nSo `toXY` turns the arrow keys into an `(x,y)` pair such that the distance is\nnormalized:\n\n    toXY { up = True , down = False, left = False, right = False, ... } == (1, 0)\n    toXY { up = True , down = False, left = False, right = True , ... } == (0.707, 0.707)\n    toXY { up = False, down = False, left = False, right = True , ... } == (0, 1)\n\nNow when you go up/right, you are still going 1 pixel per update.\n\n    import Playground exposing (..)\n\n    main =\n        game view update ( 0, 0 )\n\n    view computer ( x, y ) =\n        [ square green 40\n            |> move x y\n        ]\n\n    update computer ( x, y ) =\n        let\n            ( dx, dy ) =\n                toXY computer.keyboard\n        in\n        ( x + dx, y + dy )\n\n","type":"Playground3D.Keyboard -> ( Playground3D.Number, Playground3D.Number )"},{"name":"toY","comment":" Turn the UP and DOWN arrows into a number.\n\n    toY { up = False, down = False, ... } == 0\n    toY { up = True , down = False, ... } == 1\n    toY { up = False, down = True , ... } == -1\n    toY { up = True , down = True , ... } == 0\n\nThis can be used to move characters around in games just like [`toX`](#toX):\n\n    import Playground exposing (..)\n\n    main =\n        game view update ( 0, 0 )\n\n    view computer ( x, y ) =\n        [ square blue 40\n            |> move x y\n        ]\n\n    update computer ( x, y ) =\n        ( x + toX computer.keyboard\n        , y + toY computer.keyboard\n        )\n\n","type":"Playground3D.Keyboard -> Playground3D.Number"},{"name":"white","comment":" The color white\n","type":"Playground3D.Color"},{"name":"withCamera","comment":" Configure the camera for the scene\n","type":"Camera3d.Camera3d Length.Meters coordinates -> Playground3D.Scene coordinates -> Playground3D.Scene coordinates"},{"name":"withLighting","comment":" Set the lighting for the scene\n","type":"Playground3D.Lighting coordinates -> Playground3D.Scene coordinates -> Playground3D.Scene coordinates"},{"name":"withShadow","comment":" Add a shadow to a shape.\n","type":"Basics.Bool -> Playground3D.Shape -> Playground3D.Shape"},{"name":"yellow","comment":" The color yellow\n","type":"Playground3D.Color"}],"binops":[]}]