| 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.
Synopsis
- data Picture
- = Empty
- | Rect Double Double
- | RectF Double Double
- | Line Double Double Double Double
- | Polygon [(Double, Double)]
- | Arc Double Double Double Bool
- | CircleF Double
- | Text Font TextAlignment (Maybe Double) String
- | Image ImageSize ImageData
- | Over Picture Picture
- | Colored Color Picture
- | Rotate Double Picture
- | Translate Double Double Picture
- data Color = Color Int Int Int Float
- data TextAlignment
- type Font = String
- circle :: Double -> Picture
- path :: [(Double, Double)] -> Picture
- (<>) :: Semigroup a => a -> a -> a
Documentation
A drawable element. All Pictures are centered.
Constructors
| Empty | The empty picture. Draws nothing. |
| Rect Double Double | A rectangle from the dimensions |
| RectF Double Double | Same thing but filled |
| Line Double Double Double Double | A line from the coordinates of two points |
| Polygon [(Double, Double)] | A polygon from a list of vertices |
| Arc Double Double Double 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 Double | A filled circle from the radius |
| Text Font TextAlignment (Maybe Double) String | Draws some text. The |
| Image ImageSize ImageData | Draws an image |
| Over Picture Picture | Draws the second |
| Colored Color Picture | Applies the |
| Rotate Double Picture | Rotates the Picture (in radians) |
| Translate Double Double Picture | Moves the Picture by the given x and y distances |
Instances
| Eq Picture Source # | |
| Show Picture Source # | |
| Semigroup Picture Source # |
|
| Monoid Picture Source # |
|
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
| Eq TextAlignment Source # | |
Defined in Graphics.Shine.Picture Methods (==) :: TextAlignment -> TextAlignment -> Bool # (/=) :: TextAlignment -> TextAlignment -> Bool # | |
| Show TextAlignment Source # | |
Defined in Graphics.Shine.Picture Methods showsPrec :: Int -> TextAlignment -> ShowS # show :: TextAlignment -> String # showList :: [TextAlignment] -> ShowS # | |