Dock – automatic binding in the Kivy language

You might realize from previous chapters that the Kivy language does more than simply transform its rules to Python instructions. For instance, you might see that when it creates properties, it also binds them.

Note

When we do something common such as pos: self.parent.pos inside a layout, then the property of the parent is bound to its child. The child always moves to the parent position when the parent moves.

This is usually desirable but not all the time. Think about solo_attack of the invader. We need it to break formation and follow a free trajectory on the screen. While this happens, the whole formation of invaders continues moving from right to left and vice versa. This means that the invader will ...

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.