Book Image

Kivy - Interactive Applications and Games in Python

By : Roberto Ulloa
Book Image

Kivy - Interactive Applications and Games in Python

By: Roberto Ulloa

Overview of this book

Table of Contents (13 chapters)
Kivy – Interactive Applications and Games in Python Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Understanding the canvas


Before studying the examples of this chapter, it is important to recapitulate the following particularities related to the graphics display:

  • The coordinate space refers to the place in which we draw, which is not restricted to the windows size

  • A Canvas object is a set of instructions to draw in the coordinate space, not the place we draw in

  • All Widget objects contain their own Canvas (canvases, which we will see later) but all of them share the same coordinate space, the one in the App object.

For example, if we add a rotation instruction to a specific Canvas instance (for example, the canvas of a button), then this will also affect all the subsequent graphics instructions that are going to display graphics in the coordinate space. It doesn't matter if the graphics belong to canvases of different widgets; they all share the same coordinate space.

Therefore, we need to learn techniques to leave the coordinate space context in its original state after modifying it with...