gloss-1.13.2.1: Painless 2D vector graphics, animations and simulations.

Safe Haskell | None
Language | Haskell2010

Graphics.Gloss.Interface.IO.Simulate

Description

Simulate mode is for producing an animation of some model who's picture changes over finite time steps. The behavior of the model can also depent on the current `ViewPort`.

Synopsis

- module Graphics.Gloss.Data.Display
- module Graphics.Gloss.Data.Picture
- module Graphics.Gloss.Data.Color
- simulateIO :: forall model. Display -> Color -> Int -> model -> (model -> IO Picture) -> (ViewPort -> Float -> model -> IO model) -> IO ()
- data ViewPort = ViewPort {
  - viewPortTranslate :: !(Float, Float)
  - viewPortRotate :: !Float
  - viewPortScale :: !Float
  }

# Documentation

module Graphics.Gloss.Data.Display

module Graphics.Gloss.Data.Picture

module Graphics.Gloss.Data.Color

simulateIO #

Arguments

:: forall model. Display | Display mode.
-> Color | Background color.
-> Int | Number of simulation steps to take for each second of real time.
-> model | The initial model.
-> (model -> IO Picture) | A function to convert the model to a picture.
-> (ViewPort -> Float -> model -> IO model) | A function to step the model one iteration. It is passed the current viewport and the amount of time for this simulation step (in seconds).
-> IO () |

data ViewPort #

The `ViewPort` represents the global transformation applied to the displayed picture. When the user pans, zooms, or rotates the display then this changes the `ViewPort`.

Constructors

ViewPort |
Fields viewPortTranslate :: !(Float, Float) Global translation. viewPortRotate :: !Float Global rotation (in degrees). viewPortScale :: !Float Global scaling (of both x and y coordinates).