Copyright | (C) 2013 Fumiaki Kinoshita |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Stability | provisional |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Provides the "free" embodiment.
- data UI a
- = Draw (forall m. (Applicative m, Monad m, Picture2D m, Local m) => m a)
- | PreloadBitmap Bitmap a
- | FromFinalizer (FinalizerT IO a)
- | KeyStates (Map Key ButtonState -> a)
- | MouseButtons (Map Int ButtonState -> a)
- | MousePosition (Vec2 -> a)
- | MouseInWindow (Bool -> a)
- | TakeScreenshot (Bitmap -> a)
- | Bracket (Frame a)
- | SetFPS Int a
- | SetTitle String a
- | ShowCursor a
- | HideCursor a
- | ClearColor Color a
- | GetFPS (Int -> a)
- | ForkFrame (Frame ()) a
- | GetBoundingBox (BoundingBox2 -> a)
- | SetBoundingBox BoundingBox2 a
- reUI :: FreeGame f => UI a -> f a
- reFrame :: (FreeGame m, Monad m) => Frame a -> m a
- reGame :: (FreeGame m, Monad m) => Game a -> m a
- type Frame = F UI
- type Game = IterT Frame
- class (Picture2D m, Local m, Keyboard m, Mouse m, FromFinalizer m) => FreeGame m where
- draw :: (forall f. (Applicative f, Monad f, Picture2D f, Local f) => f a) -> m a
- preloadBitmap :: Bitmap -> m ()
- bracket :: Frame a -> m a
- forkFrame :: Frame () -> m ()
- takeScreenshot :: m Bitmap
- setFPS :: Int -> m ()
- setTitle :: String -> m ()
- showCursor :: m ()
- hideCursor :: m ()
- clearColor :: Color -> m ()
- getFPS :: m Int
- getBoundingBox :: m BoundingBox2
- setBoundingBox :: BoundingBox2 -> m ()
Documentation
Draw (forall m. (Applicative m, Monad m, Picture2D m, Local m) => m a) | |
PreloadBitmap Bitmap a | |
FromFinalizer (FinalizerT IO a) | |
KeyStates (Map Key ButtonState -> a) | |
MouseButtons (Map Int ButtonState -> a) | |
MousePosition (Vec2 -> a) | |
MouseInWindow (Bool -> a) | |
TakeScreenshot (Bitmap -> a) | |
Bracket (Frame a) | |
SetFPS Int a | |
SetTitle String a | |
ShowCursor a | |
HideCursor a | |
ClearColor Color a | |
GetFPS (Int -> a) | |
ForkFrame (Frame ()) a | |
GetBoundingBox (BoundingBox2 -> a) | |
SetBoundingBox BoundingBox2 a |
class (Picture2D m, Local m, Keyboard m, Mouse m, FromFinalizer m) => FreeGame m where Source
draw :: (forall f. (Applicative f, Monad f, Picture2D f, Local f) => f a) -> m a Source
Draw an action that consist of Picture2D'
s methods.
preloadBitmap :: Bitmap -> m () Source
bracket :: Frame a -> m a Source
Run a Frame
, and release all the matter happened.
forkFrame :: Frame () -> m () Source
Run a Frame
action concurrently. Do not use this function to draw pictures.
takeScreenshot :: m Bitmap Source
Generate a Bitmap
from the front buffer.
Set the goal FPS.
setTitle :: String -> m () Source
showCursor :: m () Source
hideCursor :: m () Source
clearColor :: Color -> m () Source
Get the actual FPS value.
getBoundingBox :: m BoundingBox2 Source
setBoundingBox :: BoundingBox2 -> m () Source
FreeGame UI | |
(FreeGame m, Monad m) => FreeGame (IdentityT m) | |
(FreeGame m, Functor m) => FreeGame (F m) | |
(FreeGame m, Functor m) => FreeGame (Free m) | |
(FreeGame m, Monad m) => FreeGame (IterT m) | |
(FreeGame m, Monad m) => FreeGame (ListT m) | |
(FreeGame m, Monad m) => FreeGame (MaybeT m) | |
(FreeGame m, Monad m) => FreeGame (ContT r m) | |
(FreeGame m, Monad m) => FreeGame (StateT s m) | |
(FreeGame m, Monad m) => FreeGame (StateT s m) | |
(FreeGame m, Monad m) => FreeGame (ExceptT e m) | |
(FreeGame m, Monad m, Monoid w) => FreeGame (WriterT w m) | |
(FreeGame m, Monad m, Monoid w) => FreeGame (WriterT w m) | |
(FreeGame m, Monad m, Monoid w) => FreeGame (RWST r w s m) | |
(FreeGame m, Monad m, Monoid w) => FreeGame (RWST r w s m) |