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

Safe HaskellNone
LanguageHaskell98

Graphics.Gloss.Interface.IO.Game

Description

This game mode lets you manage your own input. Pressing ESC will not abort the program. You also don't get automatic pan and zoom controls like with displayInWindow.

Synopsis

Documentation

playIO

Arguments

:: forall world . 
=> Display

Display mode.

-> Color

Background color.

-> Int

Number of simulation steps to take for each second of real time.

-> world

The initial world.

-> (world -> IO Picture)

An action to convert the world a picture.

-> (Event -> world -> IO world)

A function to handle input events.

-> (Float -> world -> IO world)

A function to step the world one iteration. It is passed the period of time (in seconds) needing to be advanced.

-> IO () 

Play a game in a window, using IO actions to build the pictures.

data Event

Possible input events.

Instances

data KeyState

Constructors

Down 
Up 

data Modifiers

Constructors

Modifiers 

Fields

shift :: KeyState
 
ctrl :: KeyState
 
alt :: KeyState