helm-0.1.0: A functionally reactive game engine.

Safe HaskellNone

FRP.Helm.Graphics

Synopsis

Documentation

image :: Int -> Int -> FilePath -> ElementSource

Create an element from an image with a given width, height and image file path. If the image dimensions are not the same as given, then it will stretch/shrink to fit. Only PNG files are supported currently.

croppedImage :: (Int, Int) -> Int -> Int -> FilePath -> ElementSource

Create an element from an image by cropping it with a certain position, width, height and image file path. This can be used to divide a single image up into smaller ones.

data Form Source

Constructors

Form 

Fields

theta :: Double
 
scalar :: Double
 
x :: Double
 
y :: Double
 
style :: FormStyle
 

data LineCap Source

Constructors

Flat 
Round 
Padded 

data LineStyle Source

Constructors

LineStyle 

defaultLine :: LineStyleSource

Creates the default line style. By default, the line is black with a width of 1, flat caps and regular sharp joints.

solid :: Color -> LineStyleSource

Create a solid line style with a color.

dashed :: Color -> LineStyleSource

Create a dashed line style with a color.

dotted :: Color -> LineStyleSource

Create a dotted line style with a color.

filled :: Color -> Shape -> FormSource

Creates a form from a shape by filling it with a specific color.

textured :: String -> Shape -> FormSource

Creates a form from a shape with a tiled texture and image file path.

gradient :: Gradient -> Shape -> FormSource

Creates a form from a shape filled with a gradient.

outlined :: LineStyle -> Shape -> FormSource

Creates a form from a shape by outlining it with a specific line style.

traced :: LineStyle -> Path -> FormSource

Creates a form from a path by tracing it with a specific line style.

sprite :: Int -> Int -> (Int, Int) -> FilePath -> FormSource

Creates a form from a image file path with additional position, width and height arguments. Allows you to splice smaller parts from a single image.

toForm :: Element -> FormSource

Creates a form from an element.

group :: [Form] -> FormSource

Groups a collection of forms into a single one.

groupTransform :: Matrix -> [Form] -> FormSource

Groups a collection of forms into a single one, also applying a matrix transformation.

rotate :: Double -> Form -> FormSource

Rotates a form by an amount (in radians).

scale :: Double -> Form -> FormSource

Scales a form by an amount, e.g. scaling by 2 will double the size.

move :: (Double, Double) -> Form -> FormSource

Moves a form relative to its current position.

moveX :: Double -> Form -> FormSource

Moves a form's x-coordinate relative to its current position.

moveY :: Double -> Form -> FormSource

Moves a form's y-coordinate relative to its current position.

collage :: Int -> Int -> [Form] -> ElementSource

Create an element from a collection of forms. Can be used to directly render a collection of forms.

path :: [(Double, Double)] -> PathSource

Creates a path for a collection of points.

segment :: (Double, Double) -> (Double, Double) -> PathSource

Creates a path from a line segment, i.e. a start and end point.

polygon :: [(Double, Double)] -> ShapeSource

Creates a shape from a set of points.

rect :: Double -> Double -> ShapeSource

Creates a rectangular shape with a specific width and height.

square :: Double -> ShapeSource

Creates a square shape with a specific side length.

oval :: Double -> Double -> ShapeSource

Creates an oval shape with a specific width and height.

circle :: Double -> ShapeSource

Creates an oval shape with a specific radius.

ngon :: Int -> Double -> ShapeSource

Creates a generic n-sided polygon (e.g. octagon) with a specific amount of sides and radius.