| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
YampaSDL2.InputOutput
- data AppInput
- mouseLeftActive :: SF AppInput (Event (V2 Double))
- mouseLeftPress :: SF AppInput (Event (V2 Double))
- mouseRightActive :: SF AppInput (Event (V2 Double))
- mouseRightPress :: SF AppInput (Event (V2 Double))
- anyKeyActive :: SF AppInput (Event [Scancode])
- anyKeyPress :: SF AppInput (Event [Scancode])
- quit :: SF AppInput (Event ())
- data AppOutput = AppOutput {}
- output :: Scene -> [Sound] -> Bool -> AppOutput
- data Scene = Scene {
- cam :: Camera
- objects :: [RenderObject]
- render :: Camera -> [RenderObject] -> Scene
- data Camera = Camera {}
- camera :: V2 Double -> V2 Double -> Camera
- type Center = V2 Double
- type Bounds = V4 Double
- type Cache = MVar [(String, Dynamic)]
- data RenderObject = RO {}
- translate :: (Center -> Center) -> RenderObject -> RenderObject
- data ShapeColour
- = Filled (AlphaColour Double)
- | Unfilled (AlphaColour Double)
- data Sound = NotImplementedYet
Input
Data type which stores all user inputs at the current time. You should not interact with this type directly, but use signal functions like anyKeyActive to get events.
Input Signals
Output
The Main signal function needs to return an AppOutput which tells SDL what to do.
Use output to create an AppOutput
Scene
Properties of the scene
Constructors
| Scene | |
Fields
| |
Camera
RenderObject
data RenderObject Source #
translate :: (Center -> Center) -> RenderObject -> RenderObject Source #
Move a RenderObject
data ShapeColour Source #
Used to set the colour of shapes like rectangle or circle and whether they are filled or not. This library uses Data.Colour to create colours.
Constructors
| Filled (AlphaColour Double) | |
| Unfilled (AlphaColour Double) |
Instances