| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
YampaSDL2.Draw
Contents
- circle :: Center -> Double -> ShapeColour -> Int -> RenderObject
- rectangle :: Center -> V2 Double -> ShapeColour -> Int -> RenderObject
- image :: Center -> V2 Double -> Maybe (V2 Double) -> String -> Int -> RenderObject
Draw functions
Arguments
| :: Center | center of the circle |
| -> Double | radius |
| -> ShapeColour | colour |
| -> Int | zIndex |
| -> RenderObject |
Draw a circle
Example:
circle (V2 0 0) 100 (Filled orange) 2
Arguments
| :: Center | center of the rectangle |
| -> V2 Double | size |
| -> ShapeColour | colour |
| -> Int | zIndex |
| -> RenderObject |
Draw a rectangle
Example:
rectangle (V2 0 0) (V2 100 200) (Filled blue) 3
Arguments
| :: Center | set the center point of the image |
| -> V2 Double | set the size of the image (V2 length height) |
| -> Maybe (V2 Double) | you can only use a part of the image, Nothing for the whole image |
| -> String | the file name, image must be in BMP format |
| -> Int | zIndex |
| -> RenderObject |
Draw an image
Example:
image (V2 0 0) (V2 800 600) Nothing "./path/to/image.bmp" 0