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

Graphics.Gloss.Interface.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

gameInWindowSource

Arguments

:: forall world .  
=> String

Name of the window.

-> (Int, Int)

Initial size of the window, in pixels.

-> (Int, Int)

Initial position of the window, in pixels.

-> 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 () 

Run a game in a window.

data Event Source

Possible input events.

Instances

data Key

A generalized view of keys

Instances

data MouseButton

Mouse buttons, including a wheel

data KeyState

The current state of a key or button

Constructors

Down 
Up 

data Modifiers

The state of the keyboard modifiers

Constructors

Modifiers 

Fields

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