linsyking/elm-regl/7.0.0

NOTE: the latest version is 10.0.0

Renamed to elm-messenger/elm-regl. That is where the repository lives now. It has not been published as a package under the new name.

Versions published as linsyking/elm-regl still install under that name. 5 versions of 15 come from the new location (see their notes).

REGL.BuiltinPrograms

Builtin Programs

Builtin Commands

clear : Color -> Renderable

Clear the canvas with a color.

( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> Color

Render a triangle with three vertices and color.

( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> Color

Render a quad with four vertices and color.

rectCentered : ( Float, Float ) -> ( Float, Float ) -> Float -> Color -> Renderable

Render a rectangle with center, size, angle and color.

rect : ( Float, Float ) -> ( Float, Float ) -> Color -> Renderable

Render a rectangle with left-top coordinate, size and color.

circle : ( Float, Float ) -> Float -> Color -> Renderable

Render a circle with center, radius and color.

polyPrim : List ( Float, Float ) -> List Float -> Color -> Primitive -> Renderable

Render a poly with vertices, element array, primitives and color.

poly : List ( Float, Float ) -> Color -> Renderable

Render a poly with vertices and color.

textbox : ( Float, Float ) -> Float -> String -> String -> Color -> Renderable

Render a textbox.

textboxPro : ( Float, Float ) -> TextBoxOption -> Renderable

Render a textbox with more options.

type alias TextBoxOption =
{ font : String
, text : String
, size : Float
, color : Color
, wordBreak : Bool
, thickness : Maybe Float
, italic : Maybe Float
, width : Maybe Float
, lineHeight : Maybe Float
, wordSpacing : Maybe Float
, align : Maybe String
, letterSpacing : Maybe Float
}

Full TextBox options.

( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> String

Render a texture with 4 points: left-top, right-top, right-bottom and left-bottom.

rectTexture : ( Float, Float ) -> ( Float, Float ) -> String -> Renderable

Render a texture with left-top coordinates and size.

( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> String

Render a texture with 4 points: left-top, right-top, right-bottom and left-bottom, along with 4 cropped points in texture coordinate.

( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> String

Render a texture with left-top coordinates and size, along with a crop rectangle in texture coordinate.

centeredTexture : ( Float, Float ) -> ( Float, Float ) -> Float -> String -> Renderable

Render a texture with center, size and angle for rotation.

( Float, Float )
-> ( Float, Float )
-> Float
-> ( Float, Float )
-> ( Float, Float )
-> String

Render a texture with center, size and angle for rotation.

( Float, Float )
-> ( Float, Float )
-> Float
-> Float
-> String

Render a texture with center, size and angle for rotation.

( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> Float
-> String

Render a texture with left-top coordinates and size, along with a crop rectangle in texture coordinate.

rectTextureWithAlpha : ( Float, Float ) -> ( Float, Float ) -> Float -> String -> Renderable

Render a texture with left-top coordinates and size.

( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> Float
-> String

Render a texture with 4 points: left-top, right-top, right-bottom and left-bottom, along with 4 cropped points in texture coordinate.

( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> ( Float, Float )
-> Float
-> String

Render a texture with 4 points: left-top, right-top, right-bottom and left-bottom.

( Float, Float )
-> ( Float, Float )
-> Float
-> ( Float, Float )
-> ( Float, Float )
-> Float
-> String

Render a texture with center, size and angle for rotation.

lines : List ( ( Float, Float ), ( Float, Float ) ) -> Color -> Renderable

Render lines with vertices and color.

linestrip : List ( Float, Float ) -> Color -> Renderable

Render line strip with vertices and color.

lineloop : List ( Float, Float ) -> Color -> Renderable

Render a line loop with vertices and color.

(Float -> Float)
-> ( Float, Float )
-> ( Float, Float )
-> Float
-> Color

Render a function curve with a function, offset, range, samples, and color.

Utils

toRgbaList : Color -> List Float

Convert a color to a list of RGBA values.

= Points
| Lines
| LineLoop
| LineStrip
| Triangles
| TriangleStrip
| TriangleFan

OpenGL primitive types

Convert a primitive to a value.

Advanced

Save the current FBO as a texture.

This is only an experimental feature and should be used with caution.