Class: SDL2::Event::TouchFinger
- Inherits:
-
SDL2::Event
- Object
- SDL2::Event
- SDL2::Event::TouchFinger
- Defined in:
- event.c,
event.c
Overview
This class represents touch finger events.
You don’t handle the instance of this class directly, but you handle the instances of two subclasses of this subclasses: FingerMotion, FingerDown, and FingerUp.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#finger_id ⇒ Integer
the finger id.
-
#pressure ⇒ Float
the quantity of pressure applied, normalized (0…1).
-
#touch_id ⇒ Integer
the touch device id.
-
#x ⇒ Float
the x-axis location of the touch event, normalized (0…1).
-
#y ⇒ Float
the y-axis location of the touch event, normalized (0…1).
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
#finger_id ⇒ Integer
the finger id
#pressure ⇒ Float
the quantity of pressure applied, normalized (0…1)
#touch_id ⇒ Integer
the touch device id
#x ⇒ Float
the x-axis location of the touch event, normalized (0…1)
#y ⇒ Float
the y-axis location of the touch event, normalized (0…1)
Instance Method Details
#inspect ⇒ String
Returns inspection string
954 955 956 957 958 959 960 961 962 963 |
# File 'event.c', line 954
static VALUE EvTouchFinger_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>",
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);
}
|