Modifying with multitouching

A modern use of the gestures and touches is to change the graphics of the app. What things such as pinch to zoom actually do is to scale the canvas of a widget. In this recipe, we will use the scatter widget that Kivy has for these purposes.

Getting ready

The magic of this kind of widget is understood well in the Kivy widgets tree. You could check Chapter 4, Widgets in the recipe Manipulating the widget tree.

How to do it…

You will use a Python file where you will add and set the scatter widget to the root widget. To complete the task, follow these steps:

  1. In the Python file, import the usual packages to work with Kivy.
  2. Import the Scatter widget.
  3. Define a class for the root widget.
  4. Create a simple button with a label.
  5. Create ...

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.