free-game-0.3.0.0: Create graphical applications for free.

Portabilitynon-portable
Stabilityprovisional
MaintainerFumiaki Kinsohita <fumiexcel@gmail.com>
Safe HaskellNone

Graphics.FreeGame.Base

Description

Abstract structure that represents user interfaces

Synopsis

Documentation

data GameAction cont Source

Constructors

Tick cont 
EmbedIO (IO cont) 
Bracket (Game cont) 
DrawPicture Picture cont 
LoadPicture Bitmap (Picture -> cont) 
AskInput Key (Bool -> cont) 
GetMouseState (MouseState -> cont) 

Instances

data GameParam Source

Parameters of the application.

Constructors

GameParam 

data Picture Source

A 2D Picture.

Constructors

Image Unique

An abstract image object.

Pictures [Picture]

Combined picture from some pictures.

Rotate Float Picture

Rotated picture counterclockwise by the given angle (in degrees).

Scale Vec2 Picture

Scaled picture.

Translate Vec2 Picture

A picture moved by the given coordinate.

transPicture :: (Picture -> Picture) -> GameAction cont -> GameAction contSource

Apply the function to all pictures in DrawPicture.

tick :: MonadFree GameAction m => m ()Source

Finalize the current frame and refresh the screen.

askInput :: MonadFree GameAction m => Key -> m BoolSource

Is the specified key is pressed?

getMouseState :: MonadFree GameAction m => m MouseStateSource

Get the mouse's state.

embedIO :: MonadFree GameAction m => IO a -> m aSource

Embed arbitrary IO actions into a Game monad.

bracket :: MonadFree GameAction m => Game a -> m aSource

Run a Game monad in the Game monad. resources (pictures, sounds) will be released when inner computation is done.