Chapter 2. Graphics – the Canvas
Any Kivy Widget
contains a Canvas
object. A Kivy Canvas
is a set of drawing instructions that define the graphical representation of Widget
.
Tip
Be careful with the name because it tends to be confusing! A Canvas
object is not what we draw on (for example, as it is in HTML5); it is a set of instructions to draw in the coordinate space.
The coordinate space refers to the place in which we draw. All the Kivy widgets share the same coordinate space, and a Canvas
instance, the instructions to draw on it. A coordinate space is not restricted to the size of the window or the application screen, which means that we can draw outside of the visible area.
We will discuss how to draw and manipulate the representation of the widgets ...
Get Kivy – Interactive Applications and Games in Python - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.