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 theWidget
. - 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
andPopMatrix ...
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.