Safe Haskell | None |
---|---|
Language | Haskell2010 |
Reflex.Gloss.Scene A simple scene graph implementation rendered using gloss. Contains functionality for picking and transformations. Implements interfaces for MonadSwitch (see reflex-transformers) and MonadTime (see reflex-animations) for switching, and animation support respectively.
- playSceneGraph :: Display -> Color -> Int -> (forall t. Reflex t => Scene t ()) -> IO ()
- rotation :: Reflex t => Float -> Scene t a -> Scene t a
- activeRotation :: Reflex t => Behavior t Float -> Scene t a -> Scene t a
- translation :: Reflex t => Vector -> Scene t a -> Scene t a
- activeTranslation :: Reflex t => Behavior t Vector -> Scene t a -> Scene t a
- render :: Reflex t => Behavior t Picture -> Scene t ()
- data Scene t a
- type Time = Float
- targetRect :: Reflex t => Behavior t Vector -> Scene t (Target t)
- targetCircle :: Reflex t => Behavior t Float -> Scene t (Target t)
- makeTarget :: Reflex t => Behavior t (Vector -> Bool) -> Scene t (Target t)
- hovering :: Target t -> Behavior t Bool
- data Target t
- mouseUp :: Reflex t => MouseButton -> Target t -> Event t ()
- mouseDown :: Reflex t => MouseButton -> Target t -> Event t ()
- clicked :: (Reflex t, MonadHold t m) => MouseButton -> Target t -> m (Event t (), Behavior t Bool)
- mouseOver :: (Reflex t, MonadTime t time m) => Target t -> m (Event t (), Event t ())
- data MouseButton :: *
- data SpecialKey :: *
- = KeyUnknown
- | KeySpace
- | KeyEsc
- | KeyF1
- | KeyF2
- | KeyF3
- | KeyF4
- | KeyF5
- | KeyF6
- | KeyF7
- | KeyF8
- | KeyF9
- | KeyF10
- | KeyF11
- | KeyF12
- | KeyF13
- | KeyF14
- | KeyF15
- | KeyF16
- | KeyF17
- | KeyF18
- | KeyF19
- | KeyF20
- | KeyF21
- | KeyF22
- | KeyF23
- | KeyF24
- | KeyF25
- | KeyUp
- | KeyDown
- | KeyLeft
- | KeyRight
- | KeyTab
- | KeyEnter
- | KeyBackspace
- | KeyInsert
- | KeyNumLock
- | KeyBegin
- | KeyDelete
- | KeyPageUp
- | KeyPageDown
- | KeyHome
- | KeyEnd
- | KeyShiftL
- | KeyShiftR
- | KeyCtrlL
- | KeyCtrlR
- | KeyAltL
- | KeyAltR
- | KeyPad0
- | KeyPad1
- | KeyPad2
- | KeyPad3
- | KeyPad4
- | KeyPad5
- | KeyPad6
- | KeyPad7
- | KeyPad8
- | KeyPad9
- | KeyPadDivide
- | KeyPadMultiply
- | KeyPadSubtract
- | KeyPadAdd
- | KeyPadDecimal
- | KeyPadEqual
- | KeyPadEnter
- data Input
- module Reflex.Monad
Documentation
playSceneGraph :: Display -> Color -> Int -> (forall t. Reflex t => Scene t ()) -> IO () Source
Run a scenegraph in IO
rotation :: Reflex t => Float -> Scene t a -> Scene t a Source
Rotate a child widget using a constant
activeRotation :: Reflex t => Behavior t Float -> Scene t a -> Scene t a Source
Rotate a child widget actively using a Behavior
translation :: Reflex t => Vector -> Scene t a -> Scene t a Source
Translate a child widget using a constant
activeTranslation :: Reflex t => Behavior t Vector -> Scene t a -> Scene t a Source
Translate a child widget actively using a Behavior
Scene Monad, passes down the scene graph a SceneNode, passes back up the scene graph renderings (Behavior t Picture) Implements MonadSwitch and MonadTime abstractions.
Reflex t => MonadTime t Time (Scene t) Source | |
Reflex t => MonadSample t (Scene t) Source | |
Reflex t => MonadHold t (Scene t) Source | |
Reflex t => MonadSwitch t (Scene t) Source | |
Monad (Scene t) Source | |
Functor (Scene t) Source | |
MonadFix (Scene t) Source | |
Applicative (Scene t) Source | |
Reflex t => MonadWriter [Behavior t Picture] (Scene t) Source |
targetRect :: Reflex t => Behavior t Vector -> Scene t (Target t) Source
Make a rectangular picking target
targetCircle :: Reflex t => Behavior t Float -> Scene t (Target t) Source
Make a circular picking target
makeTarget :: Reflex t => Behavior t (Vector -> Bool) -> Scene t (Target t) Source
Make a target from an intersection function
mouseUp :: Reflex t => MouseButton -> Target t -> Event t () Source
Mouse up event on a picking target
mouseDown :: Reflex t => MouseButton -> Target t -> Event t () Source
Mouse down event on a picking target
clicked :: (Reflex t, MonadHold t m) => MouseButton -> Target t -> m (Event t (), Behavior t Bool) Source
Mouse click event for picking target, returns click event and behavior indicating current clicking
mouseOver :: (Reflex t, MonadTime t time m) => Target t -> m (Event t (), Event t ()) Source
Mouse over event on a picking target, returns events for (entering, leaving)
data MouseButton :: *
data SpecialKey :: *
Input data type more covenient for splitting than the Gloss Input type
module Reflex.Monad