Storing and retrieving the coordinate space context

The graphical environment in Kivy uses a coordinate space to locate the content. In this recipe, we will take a look at how to work with the coordinate space. This recipe will define a vector and make some basic operations with it.

Getting ready

Now we are going to use the mathematical concept of vectors. You will get a better understanding of this recipe if you have the concept clear. Read the Wikipedia about it, a good start point. The implementation is made on top of a Python list, so it is important to have a good understanding of that concept too.

How to do it…

In this recipe, we will work directly with Python to show the possibilities of the vectors in Kivy, for which we will use the common ...

Get Kivy Cookbook 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.