| Copyright | (c) Francesco Gazzetta, 2016 |
|---|---|
| License | MIT |
| Maintainer | francygazz@gmail.com |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell98 |
Graphics.Shine.Picture
Description
This module contains the Picture datatype, used to represent the image to draw
on the canvas, and some functions to operate on it.
- data Picture
- = Empty
- | Rect Float Float
- | RectF Float Float
- | Line Float Float Float Float
- | Polygon [(Float, Float)]
- | Arc Float Float Float Bool
- | CircleF Float
- | Text Font TextAlignment Float String
- | Image ImageSize ImageData
- | Over Picture Picture
- | Colored Color Picture
- | Rotate Float Picture
- | Translate Float Float Picture
- data Color = Color Int Int Int Float
- data TextAlignment
- type Font = String
- circle :: Float -> Picture
- path :: [(Float, Float)] -> Picture
- (<>) :: Monoid m => m -> m -> m
Documentation
A drawable element. All Pictures are centered.
Constructors
| Empty | The empty picture. Draws nothing. |
| Rect Float Float | A rectangle from the dimensions |
| RectF Float Float | Same thing but filled |
| Line Float Float Float Float | A line from the coordinates of two points |
| Polygon [(Float, Float)] | A polygon from a list of vertices |
| Arc Float Float Float Bool | An arc from the radius, start angle, end angle. If the last parameter is True, the direction is counterclockwise TODO replace with Clockwise | Counterclockwise or remove entirely |
| CircleF Float | A filled circle from the radius |
| Text Font TextAlignment Float String | Draws some text. The float is the max width. |
| Image ImageSize ImageData | Draws an image |
| Over Picture Picture | Draws the second |
| Colored Color Picture | Applies the |
| Rotate Float Picture | Rotates the Picture (in radians) |
| Translate Float Float Picture | Moves the Picture by the given x and y distances |
A color given r, g, b (all from 0 to 255) and alpha (from 0 to 1)
data TextAlignment Source
How the text should be aligned
Constructors
| LeftAlign | |
| CenterAlign | |
| RightAlign |
Instances