Class MotionEvent

A MotionEvent is a class provided by Kivy. You will never construct a Motion event but you will recieve them as the touch values for the on_touch methods in GameController.

class MotionEvent

Objects of this class represent touch events in Kivy.

Immutable Attributes

The attributes of this class are detailed in full at the Kivy MotionEvent documention. We present the most important attributes here.

All of these attributes are essentially immutable. You should not attempt to change them. The purpose of a MotionEvent is to get information about a touch event. If you change these values, you are changing the nature of the touch event.

x

The x position of this touch.

Invariant: A number (int or float)

y

The y position of this touch.

Invariant: A number (int or float)

is_double_tap

True if the touch is a double tap; False otherwise

Invariant: A bool

double_tap_time

If the touch is a is_double_tap, this is the time between the previous tap and the current touch.

Invariant: A positive number (int or float), or None if touch is not a double tap.

time_end

Time of the end event (last touch usage)

Invariant: A positive number (int or float), or None if this is the first usage of touch.

time_start

Initial time of the touch creation

Invariant: A positive number (int or float).

time_update

Initial time of the last update (e.g. touch movement)

Invariant: A positive number (int or float).

Methods

The methods of this class are detailed in full at the Kivy MotionEvent documention. However, you should not need to use any methods. Only the attributes are important for this assignment.

Table Of Contents

Previous topic

Class Sound

Next topic

Color Models

This Page