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
.
We use RelativeLayout
in this section to avoid the problems of the shared coordinate space, but we will also explain the alternatives to it when we are inside any other type of Widget
. We will add a new file (comicwidgets.kv
) to our project. In comicreator...