Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Kivy: Interactive Applications in Python

You're reading from  Kivy: Interactive Applications in Python

Product type Book
Published in Sep 2013
Publisher Packt
ISBN-13 9781783281596
Pages 138 pages
Edition 1st Edition
Languages
Author (1):
Roberto Ulloa Roberto Ulloa
Profile icon Roberto Ulloa

Table of Contents (13) Chapters

Kivy: Interactive Applications in Python
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
1. GUI Basics – Building an Interface 2. Graphics – The Canvas 3. Widget Events – Binding Actions 4. Improving the User Experience 5. Invaders Revenge – An Interactive Multitouch Game Index

Dock – automatic binding in the Kivy language


You might realize from previous chapters that Kivy language does more than simply transforming 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 like 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 the 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 receive two orders at the same time. One from the moving parent and another from the trajectory's Animation.

That means that we need a placeholder (the Dock) for each Invader. This will secure the space for the Invader when it comes back from executing...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}