You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/scenic/primitive.ex
+24-1Lines changed: 24 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,30 @@ defmodule Scenic.Primitive do
24
24
a scene you are building and modify later as you react to events.
25
25
26
26
Once you get a primitive out of a graph via functions such as `Graph.modify`, or `Graph.get`,
27
-
You can use the generic helpers in this module to access or manipulate them.
27
+
You can use the generic helpers in this module to access or manipulate them.
28
+
29
+
## Standard primitives
30
+
31
+
The set of primitives supported in Scenic is fixed in any given version. They have been chosen
32
+
to provide the maximum flexibility when combined together, while still requiring the minimal
33
+
amount of code and maintenance.
34
+
35
+
If required, new primitives can be added in the future, but they will not work with older
36
+
versions of the drivers.
37
+
38
+
* [`Arc`](Scenic.Primitive.Arc.html) draws an arc. This would be a line cut out of a part of the edge of a circle. If you want a shape that looks like a piece of pie, then you should use the [`Sector`](Scenic.Primitive.Sector.html).
39
+
* [`Circle`](Scenic.Primitive.Circle.html) draws a circle.
40
+
* [`Ellipse`](Scenic.Primitive.Ellipse.html) draws an ellipse.
41
+
* [`Group`](Scenic.Primitive.Group.html) doesn't draw anything. Instead, it creates a node in the graph that you can insert more primitives into. Any styles or transforms you apply to the Group are inherited by all the primitives below it.
42
+
* [`Line`](Scenic.Primitive.Line.html) draws a line.
43
+
* [`Path`](Scenic.Primitive.Path.html) is sort of an escape valve for complex shapes not covered by the other primitives. You supply a list of instructions, such as :move_to, :line_to, :bezier_to, etc to generate a complex shape.
44
+
* [`Quad`](Scenic.Primitive.Quad.html) draws polygon with four sides.
45
+
* [`Rectangle`](Scenic.Primitive.Rectangle.html) draws a rectangle.
46
+
* [`RoundedRectangle`](Scenic.Primitive.RoundedRectangle.html) draws a rectangle with the corners rounded by a given radius.
47
+
* [`SceneRef`](Scenic.Primitive.SceneRef.html) doesn't draw anything by itself. Instead it points to another scene/graph and tells the driver to draw that here.
48
+
* [`Sector`](Scenic.Primitive.Sector.html) draws a shape that looks like a piece of pie. If you want to stroke just the curved edge, then combine it with an [`Arc`](Scenic.Primitive.Arc.html).
49
+
* [`Text`](Scenic.Primitive.Text.html) draws a string of text.
50
+
* [`Triangle`](Scenic.Primitive.Triangle.html) draws a triangle.
0 commit comments