processing-1.0.0.1: Web graphic applications with Processing.

Safe HaskellNone

Graphics.Web.Processing.Core.Types

Contents

Description

Collection of types.

Synopsis

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.

Instances

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

data ProcCode c Source

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.

Instances

Contexts

data Preamble Source

The preamble is the code that is executed at the beginning of the script.

Constructors

Preamble 

data Setup Source

In the setup part, settings like size or frame rate are supplied.

Constructors

Setup 

data Draw Source

The drawing loop.

Constructors

Draw 

Instances

data MouseClicked Source

Code that is executed when the mouse is clicked.

Constructors

MouseClicked 

data MouseReleased Source

Code that is executed when the mouse is released.

Constructors

MouseReleased 

Processing types

Bool

fromBool :: Bool -> Proc_BoolSource

Cast a Bool value.

Int

fromInt :: Int -> Proc_IntSource

Cast an Int value.

Float

data Proc_Float Source

Floating point numbers. The provided Eq instance checks the equality of the internal expression, not the value.

pfloor :: Proc_Float -> Proc_IntSource

Calculates the floor of a Proc_Float.

Char

fromChar :: Char -> Proc_CharSource

Cast a Char value.

Text

fromStText :: Text -> Proc_TextSource

Cast a strict Text value.

Image

Processing classes

class Proc_Eq a whereSource

Eq class for Proc_* values.

Methods

(#==) :: a -> a -> Proc_BoolSource

(#/=) :: a -> a -> Proc_BoolSource

class Proc_Ord a whereSource

Ord class for Proc_* values.

Methods

(#<=) :: a -> a -> Proc_BoolSource

(#<) :: a -> a -> Proc_BoolSource

(#>=) :: a -> a -> Proc_BoolSource

(#>) :: a -> a -> Proc_BoolSource