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

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

Graphics.FreeGame.Base

Description

Abstract structures that represents user interfaces

Synopsis

Documentation

data GameAction cont Source

A base for Game monad.

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 primitive image.

Pictures [Picture]

Combined picture from some pictures.

Rotate Float Picture

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

Scale Vec2 Picture

Scaled picture.

Translate Vec2 Picture

A picture translated by the given coordinate.

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

Lift a picture transformation into transformation of GameAction

defaultGameParam :: GameParamSource

640*480(windowed), 60fps

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 a Game monad. resources (e.g. pictures) will be released when inner computation is done.