Scenic.Primitives.quad

You're seeing just the function quad, go back to Scenic.Primitives module for more information.
Link to this function

quad(graph_or_primitive, quad, opts \\ [])

View Source

Specs

quad(
  source :: Scenic.Graph.t() | Scenic.Primitive.t(),
  quad :: Scenic.Math.quad(),
  options :: list()
) :: Scenic.Graph.t() | Scenic.Primitive.t()

Add a Quadrilateral (quad) to a graph.

Quads are defined by four points on the screen.

Data:

{ {x0,y0}, {x1,y1}, {x2,y2}, {x3,y3} }

The following example will draw a quad.

graph
|> quad( {{10,20}, {100,20}, {90, 120}, {15, 70}} )

Styles

Quads honor the following styles

  • :hidden - If true, the outline is rendered. If false, it is skipped. Default: false.
  • :fill - Fills in the interior with the specified paint. If not set, the default is to not draw anything in the interior. This is similar to specifying fill: :clear, except optimized out to do nothing.
  • :stroke - The width and paint to draw the outline with. If the stroke is not specified then the default stroke is {1, :white}
  • :join - Specifies how the lines are joined together where they meet. Can be one of :miter, :round, or :bevel. If join is not specified, then the default is :miter
  • :miter_limit - Apply an optional miter limit to the joints. If the angle is very shallow, the pointy bit might extend out far beyond the joint. Specifying :miter_limit puts a limit on the joint and bevels it if it goes out too far.

Example:

graph
|> quad( {{10,20}, {100,20}, {90, 120}, {15, 70}},
  fill: :red, stroke: {3, :blue}, join: :round )