Draw

:= []

Draw module - provides drawing primitives for the Roc raylib platform

TextureDrawBuilder

map2 : TextureDrawBuilder(a), TextureDrawBuilder(b), (a, b -> c) -> TextureDrawBuilder(c)
empty : TextureDrawBuilder({  })
run : TextureDrawBuilder(a), Texture -> TextureDrawConfig
begin_camera! : CameraMode => {  }

Hosted effects - implemented by the host

origin_for : Vector2, TextSize, TextAlign -> Vector2
draw! : Color, (() => {  }) => {  }

High-level draw function with callback pattern Ensures begin/end frame are properly paired

Circle : {
    center : Vector2,
    radius : F32,
    style : ShapeStyle,
}
Line : {
    start : Vector2,
    end : Vector2,
    stroke : Stroke,
}
LineRaw : {
    start : Vector2,
    end : Vector2,
    color : Color,
    thickness : F32,
}
Triangle : {
    a : Vector2,
    b : Vector2,
    c : Vector2,
    style : ShapeStyle,
}
Polygon : {
    points : List(Vector2),
    style : ShapeStyle,
}
HAlign : [Left, Center, Right]
VAlign : [Top, Middle, Bottom]
TextAlign : {
    horizontal : HAlign,
    vertical : VAlign,
}
Text : {
    pos : Vector2,
    text : Str,
    size : F32,
    spacing : F32,
    color : Color,
    font : Font,
    align : TextAlign,
}