gloss-1.13.1.1: Painless 2D vector graphics, animations and simulations.
Safe HaskellNone
LanguageHaskell98

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.

Constructors

EventKey Key KeyState Modifiers (Float, Float) 
EventMotion (Float, Float) 
EventResize (Int, Int) 

Instances

Instances details
Eq Event Source # 
Instance details

Defined in Graphics.Gloss.Internals.Interface.Event

Methods

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

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

Show Event Source # 
Instance details

Defined in Graphics.Gloss.Internals.Interface.Event

Methods

showsPrec :: Int -> Event -> ShowS

show :: Event -> String

showList :: [Event] -> ShowS

data Key Source #

Instances

Instances details
Eq Key Source # 
Instance details

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

Methods

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

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

Ord Key Source # 
Instance details

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

Methods

compare :: Key -> Key -> Ordering

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

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

(>) :: Key -> Key -> Bool

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

max :: Key -> Key -> Key

min :: Key -> Key -> Key

Show Key Source # 
Instance details

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

Methods

showsPrec :: Int -> Key -> ShowS

show :: Key -> String

showList :: [Key] -> ShowS

data KeyState Source #

Constructors

Down 
Up 

Instances

Instances details
Eq KeyState Source # 
Instance details

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

Methods

(==) :: KeyState -> KeyState -> Bool

(/=) :: KeyState -> KeyState -> Bool

Ord KeyState Source # 
Instance details

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

Methods

compare :: KeyState -> KeyState -> Ordering

(<) :: KeyState -> KeyState -> Bool

(<=) :: KeyState -> KeyState -> Bool

(>) :: KeyState -> KeyState -> Bool

(>=) :: KeyState -> KeyState -> Bool

max :: KeyState -> KeyState -> KeyState

min :: KeyState -> KeyState -> KeyState

Show KeyState Source # 
Instance details

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

Methods

showsPrec :: Int -> KeyState -> ShowS

show :: KeyState -> String

showList :: [KeyState] -> ShowS

data Modifiers Source #

Constructors

Modifiers 

Fields

Instances

Instances details
Eq Modifiers Source # 
Instance details

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

Methods

(==) :: Modifiers -> Modifiers -> Bool

(/=) :: Modifiers -> Modifiers -> Bool

Ord Modifiers Source # 
Instance details

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

Methods

compare :: Modifiers -> Modifiers -> Ordering

(<) :: Modifiers -> Modifiers -> Bool

(<=) :: Modifiers -> Modifiers -> Bool

(>) :: Modifiers -> Modifiers -> Bool

(>=) :: Modifiers -> Modifiers -> Bool

max :: Modifiers -> Modifiers -> Modifiers

min :: Modifiers -> Modifiers -> Modifiers

Show Modifiers Source # 
Instance details

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

Methods

showsPrec :: Int -> Modifiers -> ShowS

show :: Modifiers -> String

showList :: [Modifiers] -> ShowS