gloss-1.13.2.2: Painless 2D vector graphics, animations and simulations.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Graphics.Gloss.Interface.Pure.Game

Description

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

Synopsis

Documentation

play Source #

Arguments

:: Display

Display mode.

-> Color

Background color.

-> Int

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

-> world

The initial world.

-> (world -> Picture)

A function to convert the world a picture.

-> (Event -> world -> world)

A function to handle input events.

-> (Float -> world -> 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. Like simulate, but you manage your own input events.

data Event Source #

Possible input events.

Instances

Instances details
Show Event Source # 
Instance details

Defined in Graphics.Gloss.Internals.Interface.Event

Eq Event Source # 
Instance details

Defined in Graphics.Gloss.Internals.Interface.Event

Methods

(==) :: Event -> Event -> Bool Source #

(/=) :: Event -> Event -> Bool Source #

data Key Source #

Instances

Instances details
Show Key Source # 
Instance details

Defined in Graphics.Gloss.Internals.Interface.Backend.Types

Eq Key Source # 
Instance details

Defined in Graphics.Gloss.Internals.Interface.Backend.Types

Methods

(==) :: Key -> Key -> Bool Source #

(/=) :: Key -> Key -> Bool Source #

Ord Key Source # 
Instance details

Defined in Graphics.Gloss.Internals.Interface.Backend.Types

Methods

compare :: Key -> Key -> Ordering Source #

(<) :: Key -> Key -> Bool Source #

(<=) :: Key -> Key -> Bool Source #

(>) :: Key -> Key -> Bool Source #

(>=) :: Key -> Key -> Bool Source #

max :: Key -> Key -> Key Source #

min :: Key -> Key -> Key Source #

data SpecialKey Source #