The Canvas is the root object used for drawing by a Widget. Check module documentation for more information about the usage of Canvas.
Bases: object
Represent the smallest instruction available. This class is for internal usage only, don’t use it directly.
Bases: kivy.graphics.instructions.Instruction
Group of Instruction. Add the possibility of adding and removing graphics instruction.
Add a new Instruction in our list.
Remove all the Instruction
Insert a new Instruction in our list at index.
Remove an existing Instruction from our list.
Remove all Instruction with a specific group name.
Bases: kivy.graphics.instructions.Instruction
A context instruction is the base for creating non-display instruction for Canvas (texture binding, color parameters, matrix manipulation...)
Bases: kivy.graphics.instructions.Instruction
Property for getting/setting a filename as a source for the texture.
Property for getting/setting texture coordinates.
Property for getting/setting the texture to be bound when drawing the vertices.
Bases: kivy.graphics.instructions.CanvasBase
Our famous Canvas class. Use this class for add graphics or context instructions to use when drawing
Note
The Canvas support “with” statement.
Usage of Canvas without “with” statement:
self.canvas.add(Color(1., 1., 0))
self.canvas.add(Rectangle(size=(50, 50)))
Usage of Canvas with the “with” statement:
with self.canvas:
Color(1., 1., 0)
Rectangle(size=(50, 50))
Property for getting the after group.
Property for getting the before group.
Apply the instruction on our window.
Bases: kivy.graphics.instructions.Canvas
The render context store all the necessary information for drawing, aka: