-- 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.4 -- | Contains signals that sample input from the game window. 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) -- | Contains signals that sample input from the mouse. module FRP.Helm.Mouse -- | A data structure describing a button on a mouse. data Mouse LeftMouse :: Mouse MiddleMouse :: Mouse RightMouse :: Mouse -- | The current state of a certain mouse button. True if the mouse is -- down, false otherwise. isDown :: Mouse -> SignalGen (Signal Bool) -- | The current position of the mouse. 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) instance Show Mouse instance Eq Mouse instance Ord Mouse instance Read Mouse instance Enum Mouse -- | Contains signals that sample input from the keyboard. module FRP.Helm.Keyboard -- | A data structure describing a physical key on a keyboard. 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 KKey :: 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 KeypadNum0Key :: Key KeypadNum1Key :: Key KeypadNum2Key :: Key KeypadNum3Key :: Key KeypadNum4Key :: Key KeypadNum5Key :: Key KeypadNum6Key :: Key KeypadNum7Key :: Key KeypadNum8Key :: Key KeypadNum9Key :: 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 ModeKey :: Key ComposeKey :: Key HelpKey :: Key PrintKey :: Key SysReqKey :: Key BreakKey :: Key MenuKey :: Key PowerKey :: Key EuroKey :: Key UndoKey :: Key -- | Whether either shift key is pressed. shift :: SignalGen (Signal Bool) -- | Whether either control key is pressed. ctrl :: SignalGen (Signal Bool) -- | Whether the enter (a.k.a. return) key is pressed. enter :: SignalGen (Signal Bool) -- | Whether the space key is pressed. space :: SignalGen (Signal Bool) -- | Whether a key is pressed. isDown :: Key -> SignalGen (Signal Bool) -- | A list of keys that are currently being pressed. keysDown :: SignalGen (Signal [Key]) -- | A directional tuple combined from the arrow keys. When none of the -- arrow keys are being pressed this signal samples to (0, 0), -- otherwise it samples to a direction based on which keys are pressed. -- For example, pressing the left key results in (-1, 0), the down -- key (0, 1), up and right (1, -1), etc. arrows :: SignalGen (Signal (Int, Int)) -- | Similar to the arrows signal, but uses the popular WASD -- movement controls instead. wasd :: SignalGen (Signal (Int, Int)) instance Show Key instance Eq Key instance Ord Key instance Read Key instance Enum Key -- | Contains signals that sample input from joysticks. module FRP.Helm.Joystick -- | A type describing a joystick. type Joystick = Joystick -- | The amount of joysticks available. available :: SignalGen (Signal Int) -- | The name of a joystick. Can throw an exception when sampled if the -- joystick index is invalid. name :: Int -> SignalGen (Signal String) -- | The joystick at a certain slot. Can throw an exception when sampled if -- the joystick index is invalid. open :: Int -> SignalGen (Signal Joystick) -- | The index of a joystick. index :: Joystick -> SignalGen (Signal Int) -- | The amount of axes available for a joystick. availableAxes :: Joystick -> SignalGen (Signal Int) -- | The amount of balls available for a joystick. availableBalls :: Joystick -> SignalGen (Signal Int) -- | The amount of hats available for a joystick. availableHats :: Joystick -> SignalGen (Signal Int) -- | The amount of buttons available for a joystick. availableButtons :: Joystick -> SignalGen (Signal Int) -- | The current state of the axis of the joystick. axis :: Joystick -> Int -> SignalGen (Signal Int) -- | The current state of the hat of the joystick, returned as a -- directional tuple. For example, up is (0, -1), left (-1, -- 0), bottom-right is (1, 1), etc. hat :: Joystick -> Int -> SignalGen (Signal (Int, Int)) -- | The current state of the button of the joystick. button :: Joystick -> Int -> SignalGen (Signal Bool) -- | The current state of the ball of the joystick. ball :: Joystick -> Int -> SignalGen (Signal (Int, Int)) -- | Contains all data structures and functions for composing, calculating -- and creating automatons. module FRP.Helm.Automaton -- | A data structure describing an automaton. An automaton is essentially -- a high-level way to package piped behavior between an input signal and -- an output signal. Automatons can also be composed, allowing you to -- connect one automaton to another and pipe data between them. -- Automatons are an easy and powerful way to create composable dynamic -- behavior, like animation systems. data Automaton a b Step :: (a -> (Automaton a b, b)) -> Automaton a b -- | Creates a pure automaton that has no accumulated state. It applies -- input to a function at each step. pure :: (a -> b) -> Automaton a b -- | Creates an automaton that has an initial and accumulated state. It -- applies input and the last state to a function at each step. stateful :: b -> (a -> b -> b) -> Automaton a b -- | Combines a list of automatons that take some input and turns it into -- an automaton that takes the same input and outputs a list of all -- outputs from each separate automaton. combine :: [Automaton a b] -> Automaton a [b] -- | Steps an automaton forward, returning the next automaton to step and -- output of the step in a tuple. step :: a -> Automaton a b -> (Automaton a b, b) -- | Runs an automaton with an initial output value and input signal -- generator and creates an output signal generator that contains a -- signal that can be sampled for the output value. run :: Automaton a b -> b -> SignalGen (Signal a) -> SignalGen (Signal b) -- | A useful automaton that outputs the amount of times it has been -- stepped, discarding its input value. counter :: Automaton a Int instance Arrow Automaton instance Category Automaton -- | Contains functions for composing units of time and signals that sample -- from the game clock. module FRP.Helm.Time -- | A type describing an amount of time in an arbitary unit. Use the time -- composing/converting functions to manipulate time values. type Time = Double -- | A time value representing one millisecond. millisecond :: Time -- | A time value representing one second. second :: Time -- | A time value representing one minute. minute :: Time -- | A time value representing one hour. hour :: Time -- | Converts a time value to a fractional value, in milliseconds. inMilliseconds :: Time -> Double -- | Converts a time value to a fractional value, in seconds. inSeconds :: Time -> Double -- | Converts a time value to a fractional value, in minutes. inMinutes :: Time -> Double -- | Converts a time value to a fractional value, in hours. inHours :: Time -> Double -- | Converts a frames-per-second value into a time value. fps :: Int -> Time -- | A signal that returns the time that the game has been running for when -- sampled. running :: SignalGen (Signal Time) -- | A signal that returns the time since it was last sampled when sampled. delta :: SignalGen (Signal Time) -- | A signal that blocks the game thread for a certain amount of time when -- sampled and then returns the amount of time it blocked for. Please -- note that delaying by values smaller than 1 millisecond can have -- platform-specific results. delay :: Time -> SignalGen (Signal Time) -- | Contains utility functions for working with signals and signal -- generators. module FRP.Helm.Signal -- | Creates a signal that never changes. constant :: a -> SignalGen (Signal a) -- | Applies a function to a signal producing a new signal. This is a -- wrapper around the builtin fmap function that automatically -- binds the input signal out of the signal generator. -- --
-- render <~ Window.dimensions --lift :: (a -> b) -> SignalGen (Signal a) -> SignalGen (Signal b) -- | Applies a function to two signals. lift2 :: (a -> b -> c) -> SignalGen (Signal a) -> SignalGen (Signal b) -> SignalGen (Signal c) -- | Applies a function to three signals. lift3 :: (a -> b -> c -> d) -> SignalGen (Signal a) -> SignalGen (Signal b) -> SignalGen (Signal c) -> SignalGen (Signal d) -- | An alias for lift. (<~) :: (a -> b) -> SignalGen (Signal a) -> SignalGen (Signal b) -- | Applies a function within a signal to a signal. This is a wrapper -- around the builtin <*> operator that automatically binds -- the input signal out of the signal generator. -- --
-- render <~ Window.dimensions ~~ Window.position --(~~) :: SignalGen (Signal (a -> b)) -> SignalGen (Signal a) -> SignalGen (Signal b) -- | Creates a past-dependent signal that depends on another signal. This -- is a wrapper around the transfer function that automatically -- binds the input signal out of the signal generator. This function is -- useful for making a render function that depends on some accumulated -- state. foldp :: (a -> b -> b) -> b -> SignalGen (Signal a) -> SignalGen (Signal b) -- | Creates a signal that counts the amount of times it has been sampled. count :: SignalGen (Signal Int) -- | Creates a signal that counts the amount of times an input signal has -- passed a predicate when sampled. countIf :: (a -> Bool) -> SignalGen (Signal a) -> SignalGen (Signal Int) -- | Applies a function to four signals. lift4 :: (a -> b -> c -> d -> e) -> SignalGen (Signal a) -> SignalGen (Signal b) -> SignalGen (Signal c) -> SignalGen (Signal d) -> SignalGen (Signal e) -- | Applies a function to five signals. lift5 :: (a -> b -> c -> d -> e -> f) -> SignalGen (Signal a) -> SignalGen (Signal b) -> SignalGen (Signal c) -> SignalGen (Signal d) -> SignalGen (Signal e) -> SignalGen (Signal f) -- | Applies a function to six signals. lift6 :: (a -> b -> c -> d -> e -> f -> g) -> SignalGen (Signal a) -> SignalGen (Signal b) -> SignalGen (Signal c) -> SignalGen (Signal d) -> SignalGen (Signal e) -> SignalGen (Signal f) -> SignalGen (Signal g) -- | Applies a function to seven signals. lift7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> SignalGen (Signal a) -> SignalGen (Signal b) -> SignalGen (Signal c) -> SignalGen (Signal d) -> SignalGen (Signal e) -> SignalGen (Signal f) -> SignalGen (Signal g) -> SignalGen (Signal h) -- | Applies a function to eight signals. lift8 :: (a -> b -> c -> d -> e -> f -> g -> h -> i) -> SignalGen (Signal a) -> SignalGen (Signal b) -> SignalGen (Signal c) -> SignalGen (Signal d) -> SignalGen (Signal e) -> SignalGen (Signal f) -> SignalGen (Signal g) -> SignalGen (Signal h) -> SignalGen (Signal i) -- | Contains all data structures and functions for composing colors. module FRP.Helm.Color -- | A data structure describing a color. It is represented interally as an -- RGBA color, but the utility functions hsva, hsv, etc. -- can be used to convert from other popular formats to this structure. data Color Color :: Double -> Double -> Double -> Double -> Color -- | A data structure describing a gradient. There are two types of -- gradients: radial and linear. Radial gradients are based on a set of -- colors transitioned over certain radii in an arc pattern. Linear -- gradients are a set of colors transitioned in a straight line. data Gradient Linear :: (Double, Double) -> (Double, Double) -> [(Double, Color)] -> Gradient Radial :: (Double, Double) -> Double -> (Double, Double) -> Double -> [(Double, Color)] -> Gradient -- | Creates an RGB color, with transparency. rgba :: Double -> Double -> Double -> Double -> Color -- | Creates an RGB color. rgb :: Double -> Double -> Double -> Color -- | Create an RGBA color from HSVA values. hsva :: Double -> Double -> Double -> Double -> Color -- | Create an RGB color from HSV values. hsv :: Double -> Double -> Double -> Color -- | Calculate a complementary color for a provided color. Useful for -- outlining a filled shape in a color clearly distinguishable from the -- fill color. complement :: Color -> Color -- | Creates a linear gradient. Takes a starting position, ending position -- and a list of color stops (which are colors combined with a floating -- value between 0.0 and 1.0 that describes at what step -- along the line between the starting position and ending position the -- paired color should be transitioned to). -- --
-- linear (0, 0) (100, 100) [(0, black), (1, white)] ---- -- The above example creates a gradient that starts at (0, 0) and -- ends at (100, 100). In other words, it's a diagonal gradient, -- transitioning from the top-left to the bottom-right. The provided -- color stops result in the gradient transitioning from black to white. linear :: (Double, Double) -> (Double, Double) -> [(Double, Color)] -> Gradient -- | Creates a radial gradient. Takes a starting position and radius, -- ending position and radius and a list of color stops. See the document -- for linear for more information on color stops. radial :: (Double, Double) -> Double -> (Double, Double) -> Double -> [(Double, Color)] -> Gradient -- | A bright red color. red :: Color -- | A bright green color. lime :: Color -- | A bright blue color. blue :: Color -- | A yellow color, made from combining red and green. yellow :: Color -- | A cyan color, combined from bright green and blue. cyan :: Color -- | A magenta color, combined from bright red and blue. magenta :: Color -- | A black color. black :: Color -- | A white color. white :: Color -- | A gray color, exactly halfway between black and white. gray :: Color -- | Common alternative spelling of gray. grey :: Color -- | A medium red color. maroon :: Color -- | A medium blue color. navy :: Color -- | A medium green color. green :: Color -- | A teal color, combined from medium green and blue. teal :: Color -- | A purple color, combined from medium red and blue. purple :: Color -- | A violet color. violet :: Color -- | A dark green color. forestGreen :: Color instance Show Color instance Eq Color instance Ord Color instance Read Color instance Show Gradient instance Eq Gradient instance Ord Gradient instance Read Gradient -- | Contains all the data structures and functions for composing and -- rendering graphics. module FRP.Helm.Graphics -- | A data structure describing something that can be rendered to the -- screen. Elements are the most important structure in Helm. Games -- essentially feed the engine a stream of elements which are then -- rendered directly to the screen. The usual way to render art in a Helm -- game is to call off to the collage function, which essentially -- renders a collection of forms together. data Element CollageElement :: Int -> Int -> Bool -> [Form] -> Element ImageElement :: (Int, Int) -> Int -> Int -> FilePath -> Bool -> Element TextElement :: Text -> Element -- | A data structure describing a piece of formatted text. data Text Text :: String -> Color -> String -> Double -> FontWeight -> FontSlant -> Text textUTF8 :: Text -> String textColor :: Text -> Color textTypeface :: Text -> String textHeight :: Text -> Double textWeight :: Text -> FontWeight textSlant :: Text -> FontSlant -- | A data structure describing a form. A form is essentially a notion of -- a transformed graphic, whether it be an element or shape. See -- FormStyle for an insight into what sort of graphics can be -- wrapped in a form. data Form Form :: Double -> Double -> Double -> Double -> FormStyle -> Form formTheta :: Form -> Double formScale :: Form -> Double formX :: Form -> Double formY :: Form -> Double formStyle :: Form -> FormStyle -- | A data structure describing a few ways that graphics that can be -- wrapped in a form and hence transformed. data FormStyle PathForm :: LineStyle -> Path -> FormStyle ShapeForm :: (Either LineStyle FillStyle) -> Shape -> FormStyle ElementForm :: Element -> FormStyle GroupForm :: (Maybe Matrix) -> [Form] -> FormStyle -- | A data structure describing how a shape or path looks when filled. data FillStyle Solid :: Color -> FillStyle Texture :: String -> FillStyle Gradient :: Gradient -> FillStyle -- | A data structure describing the shape of the ends of a line. data LineCap Flat :: LineCap Round :: LineCap Padded :: LineCap -- | A data structure describing the shape of the join of a line, i.e. -- where separate line segments join. The Sharp variant takes an -- argument to limit the length of the join. data LineJoin Smooth :: LineJoin Sharp :: Double -> LineJoin Clipped :: LineJoin -- | A data structure describing how a shape or path looks when stroked. data LineStyle LineStyle :: Color -> Double -> LineCap -> LineJoin -> [Double] -> Double -> LineStyle lineColor :: LineStyle -> Color lineWidth :: LineStyle -> Double lineCap :: LineStyle -> LineCap lineJoin :: LineStyle -> LineJoin lineDashing :: LineStyle -> [Double] lineDashOffset :: LineStyle -> Double -- | A data type made up a collection of points that form a path when -- joined. type Path = [(Double, Double)] -- | A data structure describing a some sort of graphically representable -- object, such as a polygon formed from a list of points or a rectangle. data Shape PolygonShape :: Path -> Shape RectangleShape :: (Double, Double) -> Shape ArcShape :: (Double, Double) -> Double -> Double -> Double -> (Double, Double) -> Shape -- | 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 with a given width, height and image -- file path. If the image dimensions are not the same as given, then it -- will only use the relevant pixels (i.e. cut out the given dimensions -- instead of scaling). If the given dimensions are bigger than the -- actual image, than irrelevant pixels are ignored. fittedImage :: 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 -- | Create an element from a collection of forms, with width and height -- arguments. All forms are centered and clipped within the supplied -- dimensions. It is generally used to directly render a collection of -- forms. -- --
-- collage 800 600 [move (100, 100) $ filled red $ square 100, -- move (100, 100) $ outlined (solid white) $ circle 50] --collage :: Int -> Int -> [Form] -> Element -- | Like collage, but it centers the forms within the supplied -- dimensions. centeredCollage :: Int -> Int -> [Form] -> Element -- | 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 -- | 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.0 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 -- | 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 -- | Creates a shape from a path (a list of points). polygon :: Path -> Shape -- | Creates a rectangular shape with a width and height. rect :: Double -> Double -> Shape -- | Creates a square shape with a side length. square :: Double -> Shape -- | Creates an oval shape with a width and height. oval :: Double -> Double -> Shape -- | Creates a circle shape with a radius. circle :: Double -> Shape -- | Creates a generic n-sided polygon (e.g. octagon, pentagon, etc) with -- an amount of sides and radius. ngon :: Int -> Double -> Shape instance Show Text instance Eq Text instance Show FillStyle instance Eq FillStyle instance Ord FillStyle instance Read FillStyle instance Show LineCap instance Eq LineCap instance Enum LineCap instance Ord LineCap instance Read LineCap instance Show LineJoin instance Eq LineJoin instance Ord LineJoin instance Read LineJoin instance Show LineStyle instance Eq LineStyle instance Show Shape instance Eq Shape instance Ord Shape instance Read Shape instance Show FormStyle instance Eq FormStyle instance Show Form instance Eq Form instance Show Element instance Eq Element -- | Contains all data structures and functions for creating and stepping -- animations. module FRP.Helm.Animation -- | A type describing a single frame in an animation. A frame consists of -- a time at which the frame takes place in an animation and the form -- which is how the frame actually looks when rendered. type Frame = (Time, Form) -- | A type describing an animation consisting of a list of frames. newtype Animation Animation :: [Frame] -> Animation -- | Creates an animation from a list of frames. The time value in each -- frame is absolute to the entire animation, i.e. each time value is the -- time at which the frame takes place relative to the starting time of -- the animation. The list of frames should never be empty. absolute :: [Frame] -> Animation -- | Creates an animation from a list of frames. The time value in each -- frame is relative to other frames, i.e. each time value is the -- difference in time from the last frame. The list of frames should -- never be empty. -- --
-- relative [(100, picture1), (100, picture2), (300, picture3)] == absolute [(100, picture1), (200, picture2), (500, picture3)] --relative :: [Frame] -> Animation -- | Creates a signal contained in a generator that returns the current -- form in the animation when sampled from a specific animation. The -- second argument is a signal generator containing a signal that returns -- the time to setup the animation forward when sampled. The third -- argument is a signal generator containing a signal that returns true -- to continue animating or false to stop animating when sampled. animate :: Animation -> SignalGen (Signal Time) -> SignalGen (Signal Bool) -> SignalGen (Signal Form) -- | The form that will be rendered for a specific time in an animation. formAt :: Animation -> Time -> Form -- | The amount of time one cycle of the animation takes. length :: Animation -> Time instance Show Animation instance Eq Animation -- | Contains all the data structures and functions for composing pieces of -- formatted text. module FRP.Helm.Text -- | Creates a text element from a string. plainText :: String -> Element -- | Creates a text element from any showable type, defaulting to the -- monospace typeface. asText :: Show a => a -> Element -- | Creates an element from a text. text :: Text -> Element -- | Creates the default text. By default the text is black sans-serif with -- a height of 14px. defaultText :: Text -- | Creates a text from a string. toText :: String -> Text -- | Sets the weight of a piece of text to bold. bold :: Text -> Text -- | Sets the slant of a piece of text to italic. italic :: Text -> Text -- | Sets the color of a piece of text. color :: Color -> Text -> Text -- | Sets the typeface of the text to monospace. monospace :: Text -> Text -- | Sets the typeface of the text. Only fonts supported by Cairo's toy -- font API are currently supported. typeface :: String -> Text -> Text -- | Sets the size of a text noticeably large. header :: Text -> Text -- | Sets the size of a piece of text. height :: Double -> Text -> Text -- | Contains miscellaneous utility functions and the main functions for -- interfacing with the engine. module FRP.Helm -- | A type describing an amount of time in an arbitary unit. Use the time -- composing/converting functions to manipulate time values. type Time = Double -- | Initializes and runs the game engine. The supplied signal generator is -- constantly sampled for an element to render until the user quits. -- --
-- import FRP.Helm -- import qualified FRP.Helm.Window as Window -- -- render :: (Int, Int) -> Element -- render (w, h) = collage w h [filled red $ rect (fromIntegral w) (fromIntegral h)] -- -- main :: IO () -- main = run $ fmap (fmap render) Window.dimensions --run :: SignalGen (Signal Element) -> IO () -- | Converts radians into the standard angle measurement (radians). radians :: Double -> Double -- | Converts degrees into the standard angle measurement (radians). degrees :: Double -> Double -- | Converts turns into the standard angle measurement (radians). Turns -- are essentially full revolutions of the unit circle. turns :: Double -> Double