A position as a two-dimensional vector.
Modulesdl2-gfx-0.3.0.0Haskell2010
SDL.Primitive
Bindings to SDL2_gfx's primitives drawing functionality. These functions
should allow you to render various simple shapes such as lines, ellipses or
polygons.
All of the monadic functions within this module are capable of throwing an SDLException if they encounter an error.
- 8 types
- 26 values
- Packagesdl2-gfx-0.3.0.0
- Exports34
- LanguageHaskell2010
- LicenceMIT
- SourcePrimitive.hs
Pixels
3 declarationsA color as an RGBA byte-vector.
Renders a single pixel at a given position.
Lines
7 declarationsRenders a line between two points.
A length in pixels.
Renders an anti-aliased line between two points.
A width in pixels.
Triangles
3 declarationsRender a transparent triangle, its edges being of a given Color.
Same as triangle, but the edges are anti-aliased.
Rectangles
5 declarationsRenders a transparent rectangle spanning two points, bordered by a line of a given Color.
A radius in pixels.
Same as roundRectangle, but the rectangle is filled by the given Color.
Curves
13 declarationsA starting position in degrees.
An ending position in degrees.
Renders a transparent circle, bordered by a line of a given Color.
Same as circle, but the border is anti-aliased.
Same as ellipse, but makes the border anti-aliased.
How many interpolation steps when rendering a bezier curve?
The higher this is, the smoother the curve and more resource-intensive the render.
Renders a bezier curve of a given Color.
The input vectors contain the bezier curve's point locations on the x and y-axis, respectively. The input vectors need to be the same length, and those lengths must be at least 3, otherwise bezier might raise an SDLException. The same applies for the number of interpolation Steps: it must be at least 2.
Polygons
3 declarationsRender a transparent polygon, its edges of a given Color.
The input vectors contain the points' locations on the x and y-axis, respectively. The input vectors need to be the of the same length, and the lengths must be at least 3, otherwise polygon might raise an SDLException.
Same as polygon, but the edges are drawn anti-aliased.