Skip to content

Behavior

andygill edited this page Sep 19, 2014 · 2 revisions

We have a Behavior type, from FRP.

The primary way of using it is the actOnBehavior function

actOnBehavior :: Behavior a -> (a -> Canvas Bool) -> Act

(Perhaps this should be a signal function, SF a Canvas Bool)

We have the following primitives:

timerB    :: Behavior Float
eventB    :: Behavior (Maybe Blank.Event)

And the following composites.

-- Location of the mouse over the widget (normalize to 0..1)
-- sticky at edges (there is always a location)
mouseB   :: Behavior (Float,Float)   
-- Is the mouse over the widget
mouseOverB :: Behavior Bool
-- Location of the mouse on the screen (normalized to 0..1)
absMouseB  :: Behavior (Float,Float)   
-- size of this widget
sizeB :: Behavior (Float,Float)
-- clicking, 1 = click, 2 = right click
clickB :: Behavior (Maybe Int)
Clone this wiki locally