Class: SDL2::Event::FingerMotion
- Inherits:
-
TouchFinger
- Object
- SDL2::Event
- TouchFinger
- SDL2::Event::FingerMotion
- Defined in:
- ext/sdl2_ext/event.c,
ext/sdl2_ext/event.c
Overview
This class represents touch move events.
Instance Attribute Summary collapse
-
#dx ⇒ Float
the distance moved in the x-axis, normalized (0…1).
-
#dy ⇒ Float
the distance moved in the y-axis, normalized (0…1).
Attributes inherited from TouchFinger
#finger_id, #pressure, #touch_id, #x, #y
Attributes inherited from SDL2::Event
Instance Method Summary collapse
-
#inspect ⇒ String
Inspection string.
Methods inherited from SDL2::Event
enable=, enabled?, poll, #window
Instance Attribute Details
#dx ⇒ Float
the distance moved in the x-axis, normalized (0…1)
#dy ⇒ Float
the distance moved in the y-axis, normalized (0…1)
Instance Method Details
#inspect ⇒ String
Returns inspection string.
992 993 994 995 996 997 998 999 1000 1001 1002 1003 |
# File 'ext/sdl2_ext/event.c', line 992
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);
}
|