linsyking/elm-regl/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

An empty renderable object.

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.

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

Render a rounded rectangle with center, size, 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.

textboxMF : ( Float, Float ) -> Float -> String -> List String -> Color -> Renderable

Render a textbox with multiple fonts.

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

Render a textbox, centered.

textboxMFCentered : ( Float, Float ) -> Float -> String -> List String -> Color -> Renderable

Render a textbox with multiple fonts, centered.

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

Render a textbox with more options.

type alias TextBoxOption =
{ fonts : List 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
, tabSize : Maybe Float
, valign : Maybe String
, letterSpacing : Maybe Float
}

Full TextBox options.

  • fonts: A prioritized list of font family names (e.g. ["Roboto", "sans-serif"]).
  • text: The actual text content to render.
  • size: The font size in virtual canvas size.
  • color: The color of the text.
  • wordBreak: Whether long words should break across lines (True) or overflow (False).
  • thickness: Optional stroke thickness for the text (if supported by the renderer).
  • italic: Optional italic shift.
  • width: Optional maximum width of the text box. Used to wrap text.
  • lineHeight: Optional line height, as a multiplier of font size.
  • wordSpacing: Optional spacing between words, in spaces.
  • align: Optional horizontal alignment of text ("left", "center", "right").
  • tabSize: Optional width of a tab character, in spaces.
  • valign: Optional vertical alignment of text block ("top", "center", "bottom").
  • letterSpacing: Optional spacing between letters, in virtual canvas size.
defaultTextBoxOption : TextBoxOption

Default 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

= 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.