Class: SDL2::Event::FingerMotion

Inherits:
TouchFinger show all
Defined in:
event.c,
event.c

Overview

This class represents touch move events.

Instance Attribute Summary collapse

Attributes inherited from TouchFinger

#finger_id, #pressure, #touch_id, #x, #y

Attributes inherited from SDL2::Event

#timestamp, #type

Instance Method Summary collapse

Methods inherited from SDL2::Event

enable=, enabled?, poll, #window

Instance Attribute Details

#dxFloat

the distance moved in the x-axis, normalized (0…1)

Returns:

  • (Float)

#dyFloat

the distance moved in the y-axis, normalized (0…1)

Returns:

  • (Float)

Instance Method Details

#inspectString

Returns inspection string

Returns:

  • (String)

    inspection string



991
992
993
994
995
996
997
998
999
1000
1001
1002
# File 'event.c', line 991

static VALUE EvFingerMotion_inspect(VALUE self)
{
    SDL_Event* ev; Data_Get_Struct(self, SDL_Event, ev);
    return rb_sprintf("<%s: type=%u timestamp=%u"
                      " touch_id=%d finger_id=%d"
                      " x=%f y=%f pressure=%f"
                      " dy=%f dx=%f>",
                      rb_obj_classname(self), ev->common.type, ev->common.timestamp,
                      (int) ev->tfinger.touchId, (int) ev->tfinger.fingerId,
                      ev->tfinger.x, ev->tfinger.y, ev->tfinger.pressure,
                      ev->tfinger.dx, ev->tfinger.dx);
}