Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Kivy ??? Interactive Applications and Games in Python second edition
  • Table Of Contents Toc
Kivy ??? Interactive Applications and Games in Python second edition

Kivy ??? Interactive Applications and Games in Python second edition

By : Roberto Ulloa
3.7 (10)
close
close
Kivy ??? Interactive Applications and Games in Python second edition

Kivy ??? Interactive Applications and Games in Python second edition

3.7 (10)
By: Roberto Ulloa

Overview of this book

If you are a Python developer who wants to create exciting and dynamic UI/UX applications that are compatible with multiple platforms, then this is the book for you. No prior experience with Kivy is required, although you should be familiar with Python and have a fair understanding of software engineering concepts such as inheritance, classes, and instances.
Table of Contents (8 chapters)
close
close
7
Index

Chapter 1. GUI Basics – Building an Interface

Kivy is a free, open source Python library that allows for quick and easy development of highly interactive multiplatform applications. Kivy's execution speed is comparable to the native mobile alternative, Java for Android or Objective C for iOS. Moreover, Kivy has the huge advantage of being able to run on multiple platforms, just as HTML5 does; in which case, Kivy performs better because it doesn't rely on a heavy browser, and many of its components are implemented in C using the Cython library in such a way that most of the graphics processing runs directly in the GPU. Kivy strikes a great balance between performance and portability across various hardware and software environments. Kivy emerges with a simple but ambitious goal in mind:

"… same code for every platform, at least what we use every day: Linux/Windows/Mac OS X/Android/iOS"

Mathieu Virbel (http://txzone.net/2011/01/kivy-next-pymt-on-android-step-1-done/)

This support has being extended to Raspberry Pi, thanks to a crowd funding campaign started by Mathieu Virbel, the creator of Kivy. Kivy was introduced for the first time at EuroPython 2011 as a Python framework designed for creating natural user interfaces. Since then, it has grown bigger and attracted an enthusiastic community.

This book requires some knowledge of Python, and very basic terminal skills, but also it requires some understanding of Object-Oriented Programming (OOP) concepts. In particular, it is assumed that you understand the concept of inheritance and the difference between instances and classes. Refer to the following table to review some of these concepts:

Before we start, you will need to install Kivy. The installation process for all different platforms is documented and regularly updated on the Kivy website: http://kivy.org/docs/installation/installation.html.

Note

All code in this book has been tested with Kivy 1.9.0 and both Python 2.7 and Python 3.4 (but 3.3 should work fine as well).

Note that packaging support for mobile is not yet complete for Python 3.3+. For now, if we want to create mobile apps for Android or iOS, we should use Python 2.7. If you want to know your Python version, you can execute python -V in a terminal to check your installed Python version.

In this chapter, we start by creating user interfaces using one of Kivy's most fun and powerful components – the Kivy language (.kv). The Kivy Language separates logic from presentation in order to keep an easy and intuitive code; it also links components at an interface level. In future chapters, you will also learn how to build and modify interfaces dynamically using pure Python code and Kivy as a library.

Here is a list of all the skills that you are about to learn:

  • Launching a Kivy application
  • Using the Kivy language
  • Instantiating and personalizing widgets (GUI components) through basic properties and variables
  • Differentiating between fixed, proportional, absolute, and relative coordinates
  • Creating responsive GUIs through layouts
  • Modularizing code in different files

This chapter covers all the basics for building a Graphical User Interface (GUI) in Kivy. First, we will learn techniques to run an application and how to use and integrate widgets. After that, we will introduce the main project of the book, the Comic Creator, and program the main structure of the GUI that we will continue using in the following two chapters. At the end of this chapter, you will be able to build a GUI starting from a pencil and paper sketch, and also learn some techniques to make the GUI responsive to the size of the window.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Kivy ??? Interactive Applications and Games in Python second edition
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon