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
  • Table Of Contents Toc
Kivy - Interactive Applications and Games in Python

Kivy - Interactive Applications and Games in Python

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

Kivy - Interactive Applications and Games in Python

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

Localizing coordinates – adding stickmen

In the last section, we used the to_parent() method (line 66) to translate the coordinates relative to the DrawingSpace, to its parent. Remember that we were inside DraggableWidget and the coordinates we received were relative to parent (DrawingSpace).

These coordinates are convenient for DraggableWidget because we positioned it in the parent's coordinates. The method allows us to use the coordinates in the parent's collide_point. This is no longer convenient for when we want to check the coordinates on the parent's parent space or when we need to draw something directly on the canvas of a Widget.

Before studying more examples, let's review the theory. You learned that RelativeLayout is very useful because it is simpler to think inside a constraint space to localize our objects. The problems start when we need to translate coordinates to another Widget area. Let's consider the following screenshot of a Kivy program:

Localizing coordinates – adding stickmen

The...

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
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