Factory – replacing a vertex instruction

This final section of this chapter teaches a valuable trick to change the default properties of the vertex instructions. We want to change the width of all the lines on our interface. This includes the circles, lines, and stickmen. Of course, we could revisit all the classes that create the Line vertex instructions (remember that the circles are also Line instances, and the stickmen are composed of Line instances as well), and change the width property in all of them. Needless to say, that would be tedious.

Instead, we will replace the default Line class. Indeed, this is equivalent to what we just did in the previous section when we changed the label and button default properties. We have a problem in that ...

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.