shine-0.1.0.0: Declarative graphics for the browser using GHCJS

Copyright(c) Francesco Gazzetta, 2016
LicenseMIT
Maintainerfrancygazz@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell98

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

Documentation

data Picture Source

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 Picture over the first

Colored Color Picture

Applies the Color to the picture. Innermost colors have the precedence, so you can set a "global color" and override it

Rotate Float Picture

Rotates the Picture (in radians)

Translate Float Float Picture

Moves the Picture by the given x and y distances

Instances

Eq Picture Source 
Show Picture Source 
Monoid Picture Source

Pictures are Monoids. The identity is an Empty (completely transparent) picture and the composing function is the overlapping (the right picture is drawn over the left one).

data Color Source

A color given r, g, b (all from 0 to 255) and alpha (from 0 to 1)

Constructors

Color Int Int Int Float 

data TextAlignment Source

How the text should be aligned

type Font = String Source

Js-style font, ex. "12px Sans"

circle :: Float -> Picture Source

A circle from the center coordinates and radius

path :: [(Float, Float)] -> Picture Source

Shorthand to draw a series of lines

(<>) :: Monoid m => m -> m -> m infixr 6

An infix synonym for mappend.

Since: 4.5.0.0