| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Brillo.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
- module Brillo.Data.Display
- module Brillo.Data.Picture
- module Brillo.Data.Color
- play :: Display -> Color -> Int -> world -> (world -> Picture) -> (Event -> world -> world) -> (Float -> world -> world) -> IO ()
- data Event
- data Key
- data SpecialKey
- = KeyUnknown
- | KeySpace
- | KeyEsc
- | KeyF1
- | KeyF2
- | KeyF3
- | KeyF4
- | KeyF5
- | KeyF6
- | KeyF7
- | KeyF8
- | KeyF9
- | KeyF10
- | KeyF11
- | KeyF12
- | KeyF13
- | KeyF14
- | KeyF15
- | KeyF16
- | KeyF17
- | KeyF18
- | KeyF19
- | KeyF20
- | KeyF21
- | KeyF22
- | KeyF23
- | KeyF24
- | KeyF25
- | KeyUp
- | KeyDown
- | KeyLeft
- | KeyRight
- | KeyTab
- | KeyEnter
- | KeyBackspace
- | KeyInsert
- | KeyNumLock
- | KeyBegin
- | KeyDelete
- | KeyPageUp
- | KeyPageDown
- | KeyHome
- | KeyEnd
- | KeyShiftL
- | KeyShiftR
- | KeyCtrlL
- | KeyCtrlR
- | KeyAltL
- | KeyAltR
- | KeyPad0
- | KeyPad1
- | KeyPad2
- | KeyPad3
- | KeyPad4
- | KeyPad5
- | KeyPad6
- | KeyPad7
- | KeyPad8
- | KeyPad9
- | KeyPadDivide
- | KeyPadMultiply
- | KeyPadSubtract
- | KeyPadAdd
- | KeyPadDecimal
- | KeyPadEqual
- | KeyPadEnter
- data MouseButton
- data KeyState
- data Modifiers = Modifiers {}
Documentation
module Brillo.Data.Display
module Brillo.Data.Picture
module Brillo.Data.Color
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.
Possible input events.
Constructors
| EventKey Key KeyState Modifiers (Float, Float) | |
| EventMotion (Float, Float) | |
| EventResize (Int, Int) |
Instances
Constructors
| Char Char | |
| SpecialKey SpecialKey | |
| MouseButton MouseButton |
data SpecialKey Source #
Constructors
Instances
| Show SpecialKey Source # | |
Defined in Brillo.Internals.Interface.Backend.Types Methods showsPrec :: Int -> SpecialKey -> ShowS # show :: SpecialKey -> String # showList :: [SpecialKey] -> ShowS # | |
| Eq SpecialKey Source # | |
Defined in Brillo.Internals.Interface.Backend.Types | |
| Ord SpecialKey Source # | |
Defined in Brillo.Internals.Interface.Backend.Types Methods compare :: SpecialKey -> SpecialKey -> Ordering # (<) :: SpecialKey -> SpecialKey -> Bool # (<=) :: SpecialKey -> SpecialKey -> Bool # (>) :: SpecialKey -> SpecialKey -> Bool # (>=) :: SpecialKey -> SpecialKey -> Bool # max :: SpecialKey -> SpecialKey -> SpecialKey # min :: SpecialKey -> SpecialKey -> SpecialKey # | |
data MouseButton Source #
Constructors
| LeftButton | |
| MiddleButton | |
| RightButton | |
| WheelUp | |
| WheelDown | |
| AdditionalButton Int |
Instances
| Show MouseButton Source # | |
Defined in Brillo.Internals.Interface.Backend.Types Methods showsPrec :: Int -> MouseButton -> ShowS # show :: MouseButton -> String # showList :: [MouseButton] -> ShowS # | |
| Eq MouseButton Source # | |
Defined in Brillo.Internals.Interface.Backend.Types | |
| Ord MouseButton Source # | |
Defined in Brillo.Internals.Interface.Backend.Types Methods compare :: MouseButton -> MouseButton -> Ordering # (<) :: MouseButton -> MouseButton -> Bool # (<=) :: MouseButton -> MouseButton -> Bool # (>) :: MouseButton -> MouseButton -> Bool # (>=) :: MouseButton -> MouseButton -> Bool # max :: MouseButton -> MouseButton -> MouseButton # min :: MouseButton -> MouseButton -> MouseButton # | |
Instances
| Show Modifiers Source # | |
| Eq Modifiers Source # | |
| Ord Modifiers Source # | |
Defined in Brillo.Internals.Interface.Backend.Types | |