Safe Haskell | None |
---|
Contains miscellaneous utility functions and the main functions for interfacing with the engine.
- type Time = Double
- data Engine = Engine {}
- data EngineConfig = EngineConfig {
- windowDimensions :: (Int, Int)
- windowIsFullscreen :: Bool
- windowIsResizable :: Bool
- windowTitle :: String
- startup :: EngineConfig -> IO Engine
- run :: Engine -> SignalGen (Signal Element) -> IO ()
- defaultConfig :: EngineConfig
- lift :: (a -> b) -> SignalGen (Signal a) -> SignalGen (Signal b)
Types
A type describing an amount of time in an arbitary unit. Use the time composing/converting functions to manipulate time values.
A data structure describing the current engine state.
data EngineConfig Source
A data structure describing miscellaneous initial configurations of the game window and engine.
EngineConfig | |
|
Engine
startup :: EngineConfig -> IO EngineSource
Creates a new engine that can be run later using run
.
run :: Engine -> SignalGen (Signal Element) -> IO ()Source
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 [rect (fromIntegral w) (fromIntegral h) |> filled red] main :: IO () main = run defaultConfig $ lift render Window.dimensions
defaultConfig :: EngineConfigSource
Creates the default configuration for the engine. You should change the fields where necessary before passing it to run
.