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
:: 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
data SpecialKey
Special keys
data MouseButton
Mouse buttons, including a wheel