O'Reilly logo

Kivy – Interactive Applications and Games in Python - Second Edition by Roberto Ulloa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Comic Creator: PushMatrix and PopMatrix

Let's insert some graphics to the project we started in Chapter 1, GUI Basics – Building an Interface. Before this, we need to recapitulate two important lessons of this chapter related to the coordinate space:

  • The coordinate space is not restricted to any position or size. It normally has its origin in the bottom-left corner of the screen. To avoid this, we use RelativeLayout, which internally performs a translation to the position of the Widget.
  • Once the coordinate space context is transformed by any instruction, it stays like that until we specify something different. RelativeLayout also addresses this problem with two contextual instructions, which we will study in this section: PushMatrix and PopMatrix ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required