Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Kivy ??? Interactive Applications and Games in Python second edition

You're reading from   Kivy ??? Interactive Applications and Games in Python second edition Create responsive cross-platform UI/UX applications and games in Python using the open source Kivy library

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781785286926
Length 206 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Roberto Ulloa Roberto Ulloa
Author Profile Icon Roberto Ulloa
Roberto Ulloa
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Kivy – Interactive Applications and Games in Python Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. GUI Basics – Building an Interface FREE CHAPTER 2. Graphics – the Canvas 3. Widget Events – Binding Actions 4. Improving the User Experience 5. Invaders Revenge – an Interactive Multi-touch Game 6. Kivy Player – a TED Video Streamer Index

Kivy and its properties


Even though we have only touched upon explanations of properties in the previous section, the truth is that we have been using them since the beginning of this chapter. Kivy's internals are full of properties. They are almost everywhere. For example, when we implemented DraggableWidget, we simply modified the center_x property (line 72 and 73), and the whole Widget was then kept updated because there is a chain of properties involved in the use of center_x.

The last example in this chapter illustrates how powerful Kivy properties are. Here is the code for statusbar.py:

273. # File name: statusbar.py
274. from kivy.uix.boxlayout import BoxLayout
275. from kivy.properties import NumericProperty, ObjectProperty
276.
277. class StatusBar(BoxLayout):
278.    counter = NumericProperty(0)
279.    previous_counter = 0
280.
281.    def on_counter(self, instance, value):
282.        if value == 0:
283.            self.msg_label.text="Drawing space cleared"
284.        elif value...
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 £13.99/month. Cancel anytime
Visually different images