-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Gloss wrapper that simplifies writing games -- -- The game interface of the basic Gloss library combines frame-based -- rendering with user input into a simple 2D game API. Gloss.Game -- improves that API to make common tasks in game programming, such as, -- on demand image loading, animations, and event handler chains more -- convenient. @package gloss-game @version 0.3.3.0 module Graphics.Gloss.Game type Size = (Float, Float) type Rect = (Point, Size) -- | Turn a bitmap file into a picture. -- -- NB: Define loaded pictures on the toplevel to avoid reloading. bmp :: FilePath -> Picture -- | Turn a PNG file into a picture. -- -- NB: Define loaded pictures on the toplevel to avoid reloading. png :: FilePath -> Picture -- | Turn a JPEG file into a picture. -- -- NB: Define loaded pictures on the toplevel to avoid reloading. jpg :: FilePath -> Picture -- | Determine the bounding box of a picture. -- -- FIXME: Current implementation is incomplete! boundingBox :: Picture -> Rect -- | Play a game. play :: Display -> Color -> Int -> world -> (world -> Picture) -> (Event -> world -> world) -> [Float -> world -> world] -> IO () -- | Play a game in a scene. playInScene :: Display -> Color -> Int -> world -> Scene world -> (Float -> Event -> world -> world) -> [Float -> Float -> world -> world] -> IO () -- | An abstract representation of an animation. data Animation -- | Construct a new animation with a list of pictures for the animation, -- the time between animation frames, and a given (absolute) start time. animation :: [Picture] -> Float -> Float -> Animation -- | An empty animation. noAnimation :: Animation animationPicture :: Animation -> Float -> Maybe Picture -- | A scene describes the rendering of a world state — i.e., which picture -- should be draw depending on the current time and of the state of the -- world. data Scene world -- | Turn a static picture into a scene. picture :: Picture -> Scene world -- | Turn a world-dependent picture into a scene. picturing :: (world -> Picture) -> Scene world -- | Animate a world-dependent animation. The default picture is displayed -- while no animation is running. animating :: (world -> Animation) -> Picture -> Scene world -- | Move a scene in dependences on a world-dependent location. translating :: (world -> Point) -> Scene world -> Scene world -- | Rotate a scene in dependences on a world-dependent angle. rotating :: (world -> Float) -> Scene world -> Scene world -- | Scale a scene in dependences on world-dependent scaling factors. scaling :: (world -> (Float, Float)) -> Scene world -> Scene world -- | Compose a scene from a list of scenes. scenes :: [Scene world] -> Scene world -- | Render a scene on the basis of time since playing started and the -- specific world state. drawScene :: Scene world -> Float -> world -> Picture