-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A functionally reactive game engine. -- -- A functionally reactive game engine, with headgear to protect you from -- the headache of game development provided. @package helm @version 0.1.0 module FRP.Helm.Window -- | The current dimensions of the window. dimensions :: SignalGen (Signal (Int, Int)) -- | The current width of the window. width :: SignalGen (Signal Int) -- | The current height of the window. height :: SignalGen (Signal Int) module FRP.Helm.Mouse -- | The current mouse position. position :: SignalGen (Signal (Int, Int)) -- | The current x-coordinate of the mouse. x :: SignalGen (Signal Int) -- | The current y-coordinate of the mouse. y :: SignalGen (Signal Int) -- | The current state of a certain mouse button. True if the mouse is -- down, false otherwise. isDown :: Mouse -> SignalGen (Signal Bool) data Mouse LeftMouse :: Mouse MiddleMouse :: Mouse RightMouse :: Mouse module FRP.Helm.Keyboard -- | Whether either shift key is pressed. shift :: SignalGen (Signal Bool) -- | Whether either control key is pressed. ctrl :: SignalGen (Signal Bool) -- | Whether the shift key is pressed. enter :: SignalGen (Signal Bool) data Key BackspaceKey :: Key TabKey :: Key ClearKey :: Key EnterKey :: Key PauseKey :: Key EscapeKey :: Key SpaceKey :: Key ExclaimKey :: Key QuotedBlKey :: Key HashKey :: Key DollarKey :: Key AmpersandKey :: Key QuoteKey :: Key LeftParenKey :: Key RightParenKey :: Key AsteriskKey :: Key PlusKey :: Key CommaKey :: Key MinusKey :: Key PeriodKey :: Key SlashKey :: Key Num0Key :: Key Num1Key :: Key Num2Key :: Key Num3Key :: Key Num4Key :: Key Num5Key :: Key Num6Key :: Key Num7Key :: Key Num8Key :: Key Num9Key :: Key ColonKey :: Key SemicolonKey :: Key LessKey :: Key EqualsKey :: Key GreaterKey :: Key QuestionKey :: Key AtKey :: Key LeftBracketKey :: Key BackslashKey :: Key RightBracketKey :: Key CaretKey :: Key UnderscoreKey :: Key BackquoteKey :: Key AKey :: Key BKey :: Key CKey :: Key DKey :: Key EKey :: Key FKey :: Key GKey :: Key HKey :: Key IKey :: Key JKey :: Key LKey :: Key MKey :: Key NKey :: Key OKey :: Key PKey :: Key QKey :: Key RKey :: Key SKey :: Key TKey :: Key UKey :: Key VKey :: Key WKey :: Key XKey :: Key YKey :: Key ZKey :: Key DeleteKey :: Key Keypad0Key :: Key Keypad1Key :: Key Keypad2Key :: Key Keypad3Key :: Key Keypad4Key :: Key Keypad5Key :: Key Keypad6Key :: Key Keypad7Key :: Key Keypad8Key :: Key Keypad9Key :: Key KeypadPeriodKey :: Key KeypadDivideKey :: Key KeypadMultiplyKey :: Key KeypadMinusKey :: Key KeypadPlusKey :: Key KeypadEnterKey :: Key KeypadEqualsKey :: Key UpKey :: Key DownKey :: Key RightKey :: Key LeftKey :: Key InsertKey :: Key HomeKey :: Key EndKey :: Key PageUpKey :: Key PageDownKey :: Key F1Key :: Key F2Key :: Key F3Key :: Key F4Key :: Key F5Key :: Key F6Key :: Key F7Key :: Key F8Key :: Key F9Key :: Key F10Key :: Key F11Key :: Key F12Key :: Key F13Key :: Key F14Key :: Key F15Key :: Key NumLockKey :: Key CapsLockKey :: Key ScrollLockKey :: Key RShiftKey :: Key LShiftKey :: Key RCtrlKey :: Key LCtrlKey :: Key RAltKey :: Key LAltKey :: Key RMetaKey :: Key LMetaKey :: Key RSuperKey :: Key LSuperKey :: Key ComposeKey :: Key HelpKey :: Key PrintKey :: Key SysReqKey :: Key BreakKey :: Key MenuKey :: Key PowerKey :: Key EuroKey :: Key UndoKey :: Key -- | Whether the space key is pressed. space :: SignalGen (Signal Bool) -- | A unit vector combined from the arrow keys. When no keys are being -- pressed this signal samples to (0, 0), otherwise it samples to a -- specific direction based on which keys are pressed. For example, -- pressing the left key results in (-1, 0), the down key (0, 1), etc. arrows :: SignalGen (Signal (Int, Int)) -- | Similar to the arrows signal, but uses the W, A, S and D keys -- instead. wasd :: SignalGen (Signal (Int, Int)) module FRP.Helm.Color data Color Color :: !Double -> !Double -> !Double -> !Double -> Color r :: Color -> !Double g :: Color -> !Double b :: Color -> !Double a :: Color -> !Double -- | Creates an RGB color. rgb :: Double -> Double -> Double -> Color -- | Creates an RGB color, with transparency. rgba :: Double -> Double -> Double -> Double -> Color red :: Color lime :: Color blue :: Color yellow :: Color cyan :: Color magenta :: Color black :: Color white :: Color gray :: Color grey :: Color maroon :: Color navy :: Color green :: Color teal :: Color purple :: Color violet :: Color forestGreen :: Color data Gradient Linear :: (Double, Double) -> (Double, Double) -> [(Double, Color)] -> Gradient Radial :: (Double, Double) -> Double -> (Double, Double) -> Double -> [(Double, Color)] -> Gradient -- | Creates a linear gradient. Takes an linear :: (Double, Double) -> (Double, Double) -> [(Double, Color)] -> Gradient -- | Creates a radial gradient. radial :: (Double, Double) -> Double -> (Double, Double) -> Double -> [(Double, Color)] -> Gradient module FRP.Helm.Graphics data Element CollageElement :: Int -> Int -> [Form] -> Element ImageElement :: (Int, Int) -> Int -> Int -> FilePath -> Bool -> Element -- | Create an element from an image with a given width, height and image -- file path. If the image dimensions are not the same as given, then it -- will stretch/shrink to fit. Only PNG files are supported currently. image :: Int -> Int -> FilePath -> Element -- | Create an element from an image by cropping it with a certain -- position, width, height and image file path. This can be used to -- divide a single image up into smaller ones. croppedImage :: (Int, Int) -> Int -> Int -> FilePath -> Element data Form Form :: Double -> Double -> Double -> Double -> FormStyle -> Form theta :: Form -> Double scalar :: Form -> Double x :: Form -> Double y :: Form -> Double style :: Form -> FormStyle data FillStyle Solid :: Color -> FillStyle Texture :: String -> FillStyle Gradient :: Gradient -> FillStyle data LineCap Flat :: LineCap Round :: LineCap Padded :: LineCap data LineJoin Smooth :: LineJoin Sharp :: Double -> LineJoin Clipped :: LineJoin data LineStyle LineStyle :: Color -> Double -> LineCap -> LineJoin -> [Double] -> Double -> LineStyle color :: LineStyle -> Color width :: LineStyle -> Double cap :: LineStyle -> LineCap join :: LineStyle -> LineJoin dashing :: LineStyle -> [Double] dashOffset :: LineStyle -> Double -- | Creates the default line style. By default, the line is black with a -- width of 1, flat caps and regular sharp joints. defaultLine :: LineStyle -- | Create a solid line style with a color. solid :: Color -> LineStyle -- | Create a dashed line style with a color. dashed :: Color -> LineStyle -- | Create a dotted line style with a color. dotted :: Color -> LineStyle data FormStyle PathForm :: LineStyle -> Path -> FormStyle ShapeForm :: (Either LineStyle FillStyle) -> Shape -> FormStyle ElementForm :: Element -> FormStyle GroupForm :: Matrix -> [Form] -> FormStyle -- | Creates a form from a shape by filling it with a specific color. filled :: Color -> Shape -> Form -- | Creates a form from a shape with a tiled texture and image file path. textured :: String -> Shape -> Form -- | Creates a form from a shape filled with a gradient. gradient :: Gradient -> Shape -> Form -- | Creates a form from a shape by outlining it with a specific line -- style. outlined :: LineStyle -> Shape -> Form -- | Creates a form from a path by tracing it with a specific line style. traced :: LineStyle -> Path -> Form -- | Creates a form from a image file path with additional position, width -- and height arguments. Allows you to splice smaller parts from a single -- image. sprite :: Int -> Int -> (Int, Int) -> FilePath -> Form -- | Creates a form from an element. toForm :: Element -> Form -- | Groups a collection of forms into a single one. group :: [Form] -> Form -- | Groups a collection of forms into a single one, also applying a matrix -- transformation. groupTransform :: Matrix -> [Form] -> Form -- | Rotates a form by an amount (in radians). rotate :: Double -> Form -> Form -- | Scales a form by an amount, e.g. scaling by 2 will double the size. scale :: Double -> Form -> Form -- | Moves a form relative to its current position. move :: (Double, Double) -> Form -> Form -- | Moves a form's x-coordinate relative to its current position. moveX :: Double -> Form -> Form -- | Moves a form's y-coordinate relative to its current position. moveY :: Double -> Form -> Form -- | Create an element from a collection of forms. Can be used to directly -- render a collection of forms. collage :: Int -> Int -> [Form] -> Element type Path = [(Double, Double)] -- | Creates a path for a collection of points. path :: [(Double, Double)] -> Path -- | Creates a path from a line segment, i.e. a start and end point. segment :: (Double, Double) -> (Double, Double) -> Path type Shape = [(Double, Double)] -- | Creates a shape from a set of points. polygon :: [(Double, Double)] -> Shape -- | Creates a rectangular shape with a specific width and height. rect :: Double -> Double -> Shape -- | Creates a square shape with a specific side length. square :: Double -> Shape -- | Creates an oval shape with a specific width and height. oval :: Double -> Double -> Shape -- | Creates an oval shape with a specific radius. circle :: Double -> Shape -- | Creates a generic n-sided polygon (e.g. octagon) with a specific -- amount of sides and radius. ngon :: Int -> Double -> Shape module FRP.Helm -- | Converts radians into the standard angle measurement (radians). radians :: Float -> Float -- | Converts degrees into the standard angle measurement (radians). degrees :: Float -> Float -- | Converts turns into the standard angle measurement (radians). Turns -- are essentially full revolutions of the unit circle. turns :: Float -> Float -- | Initializes and runs the game engine. The supplied signal generator is -- constantly sampled for an element to render until the user quits. run :: SignalGen (Signal Element) -> IO ()