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

Safe Haskell | None
Language | Haskell2010

Graphics.Gloss.Interface.IO.Animate

Description

Animate a picture in a window.

Synopsis

- module Graphics.Gloss.Data.Display
- module Graphics.Gloss.Data.Picture
- module Graphics.Gloss.Data.Color
- animateIO :: Display -> Color -> (Float -> IO Picture) -> (Controller -> IO ()) -> IO ()
- animateFixedIO :: Display -> Color -> (Float -> IO Picture) -> (Controller -> IO ()) -> IO ()
- data Controller = Controller {
  - controllerSetRedraw :: IO ()
  - controllerModifyViewPort :: (ViewPort -> IO ViewPort) -> IO ()
  }

# Documentation

module Graphics.Gloss.Data.Display

module Graphics.Gloss.Data.Picture

module Graphics.Gloss.Data.Color

animateIO #

Arguments

:: Display | Display mode.
-> Color | Background color.
-> (Float -> IO Picture) | Function to produce the next frame of animation. It is passed the time in seconds since the program started.
-> (Controller -> IO ()) | Callback to take the display controller.
-> IO () |

Open a new window and display the given animation.

Once the window is open you can use the same commands as with `display`.

animateFixedIO #

Arguments

:: Display | Display mode.
-> Color | Background color.
-> (Float -> IO Picture) | Function to produce the next frame of animation. It is passed the time in seconds since the program started.
-> (Controller -> IO ()) | Callback to take the display controller.
-> IO () |

Like `animateIO` but don't allow the display to be panned around.

data Controller #

Functions to asynchronously control a `Gloss` display.

Constructors

Controller |
Fields controllerSetRedraw :: IO () Indicate that we want the picture to be redrawn. controllerModifyViewPort :: (ViewPort -> IO ViewPort) -> IO () Modify the current viewport, also indicating that it should be redrawn.