Safe Haskell | None |
---|
Collection of types.
- data ProcScript = ProcScript {}
- emptyScript :: ProcScript
- renderScript :: ProcScript -> Text
- renderFile :: FilePath -> ProcScript -> IO ()
- data ProcCode c
- data Preamble = Preamble
- data Setup = Setup
- data Draw = Draw
- data MouseClicked = MouseClicked
- data MouseReleased = MouseReleased
- class ProcType a
- data Proc_Bool
- true :: Proc_Bool
- false :: Proc_Bool
- fromBool :: Bool -> Proc_Bool
- pnot :: Proc_Bool -> Proc_Bool
- (#||) :: Proc_Bool -> Proc_Bool -> Proc_Bool
- (#&&) :: Proc_Bool -> Proc_Bool -> Proc_Bool
- data Proc_Int
- fromInt :: Int -> Proc_Int
- intToFloat :: Proc_Int -> Proc_Float
- data Proc_Float
- fromFloat :: Float -> Proc_Float
- pfloor :: Proc_Float -> Proc_Int
- data Proc_Char
- fromChar :: Char -> Proc_Char
- data Proc_Text
- fromStText :: Text -> Proc_Text
- data Proc_Image
- class Proc_Eq a where
- class Proc_Ord a where
Processing Script
data ProcScript Source
A complete Processing script.
It consists in several parts, most of them optional.
-
Preamble
: Usually the place where variables are initialized. -
Setup
: After running the code in the preamble, the code in this part is executed once. -
Draw
: After the setup, this part of the code is executed in loops over and over again. -
MouseClicked
: Each time the user clicks, the code here is executed once.
To generate each part of the code, use the ProcM
monad
and the functions from the Graphics.Web.Processing.Interface
module. Then, run runProcM
or execProcM
to get the
code result.
emptyScript :: ProcScriptSource
Empty script.
Script rendering
renderScript :: ProcScript -> TextSource
Render a script as a lazy Text
.
renderFile :: FilePath -> ProcScript -> IO ()Source
Render a script using renderScript
and
write it directly in a file.
Processing Code
A piece of Processing code. The type parameter indicates what the context of the code is. This context will allow or disallow the use of certain commands.
Contexts
The preamble is the code that is executed at the beginning of the script.
In the setup part, settings like size or frame rate are supplied.
data MouseClicked Source
Code that is executed when the mouse is clicked.
data MouseReleased Source
Code that is executed when the mouse is released.
Processing types
Class of Processing value types.
Bool
Boolean values.
Int
Integer numbers.
intToFloat :: Proc_Int -> Proc_FloatSource
Cast a Proc_Int
to a Proc_Float
.
Float
data Proc_Float Source
Floating point numbers.
The provided Eq
instance checks the equality of the
internal expression, not the value.
Eq Proc_Float | |
Floating Proc_Float | WARNING: |
Fractional Proc_Float | |
Num Proc_Float | WARNING: |
Ord Proc_Float | |
Pretty Proc_Float | |
Proc_Ord Proc_Float | |
Proc_Eq Proc_Float | |
ProcType Proc_Float | |
VarLength Proc_Float | |
CustomValue Proc_Float |
fromFloat :: Float -> Proc_FloatSource
Cast a Float
value.
pfloor :: Proc_Float -> Proc_IntSource
Calculates the floor
of a Proc_Float
.
Char
Type of characters.
Text
Type of textual values.
fromStText :: Text -> Proc_TextSource
Cast a strict Text
value.
Image
data Proc_Image Source
Type of images.
Processing classes
Eq
class for Proc_*
values.