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
.
- module Graphics.Gloss.Data.Picture
- module Graphics.Gloss.Data.Color
- gameInWindow :: forall world. String -> (Int, Int) -> (Int, Int) -> Color -> Int -> world -> (world -> Picture) -> (Event -> world -> world) -> (Float -> world -> world) -> IO ()
- data Event
- data Key
- data SpecialKey
- data MouseButton
- = LeftButton
- | MiddleButton
- | RightButton
- | WheelUp
- | WheelDown
- | AdditionalButton Int
- data KeyState
- data Modifiers = Modifiers {}
Documentation
module Graphics.Gloss.Data.Picture
module Graphics.Gloss.Data.Color
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.
Possible input events.
data Key
A generalized view of keys
Constructors
Char Char | |
SpecialKey SpecialKey | |
MouseButton MouseButton |
data SpecialKey
Special keys
Constructors
KeyF1 | |
KeyF2 | |
KeyF3 | |
KeyF4 | |
KeyF5 | |
KeyF6 | |
KeyF7 | |
KeyF8 | |
KeyF9 | |
KeyF10 | |
KeyF11 | |
KeyF12 | |
KeyLeft | |
KeyUp | |
KeyRight | |
KeyDown | |
KeyPageUp | |
KeyPageDown | |
KeyHome | |
KeyEnd | |
KeyInsert | |
KeyNumLock | |
KeyBegin | |
KeyDelete |
Instances
data MouseButton
Mouse buttons, including a wheel
Constructors
LeftButton | |
MiddleButton | |
RightButton | |
WheelUp | |
WheelDown | |
AdditionalButton Int |
Instances
data KeyState
The current state of a key or button