Gamgine-0.5: Some kind of game library or set of utilities.

Safe HaskellNone
LanguageHaskell98

Gamgine.State.State

Synopsis

Documentation

data State a Source

an application state

Constructors

State 

Fields

enter :: MousePos -> a -> Maybe (a, State a)

called when the state is entered, when Nothing is returned, than the state couldn't be entered

leave :: a -> (a, State a)

called when the state is leaved

update :: a -> (a, State a)

called for each application update cycle

render :: RenderState -> a -> IO (a, State a)

called for each frame rendering

keyEvent :: KeyInfo -> a -> (a, State a)

called when a key was pressed/released

mouseEvent :: MouseInfo -> a -> (a, State a)

called when a mouse button was pressed/released

mouseMoved :: MousePos -> a -> (a, State a)

called when a mouse was moved