Safe Haskell | None |
---|---|
Language | Haskell98 |
Warning: This is an experimental API. It can change at any time.
Synopsis
- data Parameter
- parametricDrawingOf :: [Parameter] -> ([Double] -> Picture) -> IO ()
- slider :: Text -> Parameter
- toggle :: Text -> Parameter
- counter :: Text -> Parameter
- constant :: Text -> Double -> Parameter
- random :: Text -> Parameter
- timer :: Text -> Parameter
- currentHour :: Parameter
- currentMinute :: Parameter
- currentSecond :: Parameter
- converted :: (Double -> Double) -> Parameter -> Parameter
- renamed :: Text -> Parameter -> Parameter
Documentation
The source for a parameter that can be adjusted in a parametric drawing. Parameters can get their values from sliders, buttons, counters, timers, etc.
parametricDrawingOf :: [Parameter] -> ([Double] -> Picture) -> IO () Source #
A drawing that depends on parameters. The first argument is a list of parameters. The second is a picture, which depends on the values of those parameters. Each number used to retrieve the picture is the value of the corresponding parameter in the first list.
constant :: Text -> Double -> Parameter Source #
A Parameter
with a constant value, and no way to change it.
random :: Text -> Parameter Source #
A Parameter
that has a randomly chosen value. It offers a button to
regenerate its value.
currentHour :: Parameter Source #
A Parameter
that tracks the current hour, in local time. The hour
is on a scale from 0 (meaning midnight) to 23 (meaning 11:00 pm).
currentMinute :: Parameter Source #
A Parameter
that tracks the current minute, in local time. It
ranges from 0 to 59.
currentSecond :: Parameter Source #
A Parameter
that tracks the current second, in local time. It
ranges from 0.0 up to (but not including) 60.0. This includes
fractions of a second. If that's not what you want, you can use
withConversion
to truncate the number.