Using drawing instructions
Let's start to create some new graphics. In a visual app, astonishing graphics are fundamentals. This recipe will create some basic geometric shapes.
Getting ready
This recipe uses the OpenGL philosophy about drawing; if you are not familiar with this, you have to keep in mind that the drawing of geometric shapes is based on the mathematical knowledge behind them. For example, the triangle needs three points to be drawn, but not any three points can draw a triangle.
How to do it…
In this recipe, in the KV file, we will be adding four drawing instructions to the root widget canvas, and we will have a simple Python file for our app. To complete the recipe, follow these steps:
In the KV file, define the rule for the root widget.
Define the canvas property for the root widget.
Add the drawing instructions for an ellipse.
Add the drawing instructions for a rectangle.
Add the drawing instructions for a triangle.
Add the drawing instructions for a line:
<MyW>: canvas:...