reflex-gloss-scene-0.1: A simple scene-graph using reflex and gloss

Safe HaskellNone
LanguageHaskell2010

Reflex.Gloss.Scene

Description

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.

Synopsis

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

render :: Reflex t => Behavior t Picture -> Scene t () Source

Render a picture in the current widget

data Scene t a Source

Scene Monad, passes down the scene graph a SceneNode, passes back up the scene graph renderings (Behavior t Picture) Implements MonadSwitch and MonadTime abstractions.

type Time = Float Source

Time is just a float!

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

data Target t Source

Type for picking targets

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 Input Source

Input data type more covenient for splitting than the Gloss Input type