You are previewing Kivy: Interactive Applications in Python.
O'Reilly logo
Kivy: Interactive Applications in Python

Book Description

For Python developers this is the clearest guide to the interactive world of Kivi, ideal for meeting modern expectations of tablets and smartphones. From building a UI to controlling complex multi-touch events, it’s all here.

  • Use Kivy to implement apps and games in Python that run on multiple platforms

  • Discover how to build a User Interface (UI) through the Kivy Language

  • Glue the UI components with the logic of the applications through events and the powerful Kivy properties

  • Detect gestures, create animations, and schedule tasks

  • Control multi-touch events in order to improve the User Experience (UX)

  • In Detail

    Mobiles and tablets have brought with them a dramatic change in the utility of applications. Compatibility has become essential, and this has increased the kind of interaction that users expect: gestures, multi-touches, animations, and magic pens. Kivy is an open source Python solution that covers these market needs with an easy-to-learn and rapid development approach. Kivy is growing fast and gaining attention as an alternative to the established developing platforms.

    Kivy: Interactive Applications in Python quickly introduces you to the Kivy development methodology. You will learn some examples of how to use many of the Kivy components, as well as understand how to integrate and combine them into big projects. This book serves as a reference guide and is organized in such a way that once finished, you will have already completed your first project.

    You will start by learning the Kivy Language for building User Interfaces (UI) and vector figures. We then proceed to the uses of Kivy events and properties to glue the UI with the application logic.

    You then go on to build an entire User Interface (UI) starting from a hand-made sketch. Furthermore, you will go on to understand how to use the canvas and drawing instructions to create different types of geometrical figures. Finally, you will be introduced to a big set of interactive and smooth features: transformations (scale, rotate, and translate), gestures, animations, scheduling tasks, and multi-touch elements.

    Kivy: Interactive Applications in Python expands your knowledge by introducing various components that improve the User Experience (UX). Towards the end of the book, you will be confident to utilize Kivy components and strategies to start any application or game you have in mind.

    Table of Contents

    1. Kivy: Interactive Applications in Python
      1. Table of Contents
      2. Kivy: Interactive Applications in Python
      3. Credits
      4. About the Author
      5. Acknowledgments
      6. About the Reviewers
      7. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      8. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      9. 1. GUI Basics – Building an Interface
        1. Hello World!
        2. Basic widgets – labels and buttons
        3. Layouts
        4. Embedding layouts
        5. Our Project – comic creator
        6. Summary
      10. 2. Graphics – The Canvas
        1. Basic shapes
        2. Images, colors, and backgrounds
        3. Rotating, translating, and scaling
        4. Comic creator – PushMatrix and PopMatrix
        5. Summary
      11. 3. Widget Events – Binding Actions
        1. Attributes, id and root
        2. Basic widget events – dragging the stickman
        3. Localizing coordinates – adding stickmen
        4. Binding and unbinding events – sizing limbs and heads
        5. Binding events in the Kivy language
        6. Creating your own events – the magical properties
        7. Kivy and properties
        8. Summary
      12. 4. Improving the User Experience
        1. Screen manager – selecting colors for the figures
        2. Color Control on the canvas – coloring figures
        3. StencilView – limiting the drawing space
        4. Scatter – multitouching to drag, rotate, and scale
        5. Recording gestures – line, circles, and cross
        6. Simple gestures – drawing with the finger
        7. Summary
      13. 5. Invaders Revenge – An Interactive Multitouch Game
        1. Invaders Revenge – an animated multitouch game
        2. Atlas – efficient management of images
        3. Boom – simple sound effects
        4. Ammo – simple animation
        5. Invader – transitions for animations
        6. Dock – automatic binding in the Kivy language
        7. Fleet – infinite concatenation of animations
        8. Scheduling events with the Clock
        9. Shooter – multitouch control
        10. Invasion – moving the shooter with the keyboard
        11. Combining animations with '+' and '&'
        12. Summary
      14. Index