Class: SDL2::Event::Multigesture

Inherits:
SDL2::Event show all
Defined in:
ext/sdl2_ext/event.c,
ext/sdl2_ext/event.c

Overview

This class represents multiple finger gesture events.

Instance Attribute Summary collapse

Attributes inherited from SDL2::Event

#timestamp, #type

Instance Method Summary collapse

Methods inherited from SDL2::Event

enable=, enabled?, poll, #window

Instance Attribute Details

#d_distFloat

amount of fingers pinched

Returns:

  • (Float)

#d_thetaFloat

rotation of fingers

Returns:

  • (Float)

#num_fingersInteger

number of fingers involved

Returns:

  • (Integer)

#touch_idInteger

the touch device id

Returns:

  • (Integer)

#xFloat

the x-axis location of the touch event, normalized (0…1)

Returns:

  • (Float)

#yFloat

the y-axis location of the touch event, normalized (0…1)

Returns:

  • (Float)

Instance Method Details

#inspectString

Returns inspection string.

Returns:

  • (String)

    inspection string



1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
# File 'ext/sdl2_ext/event.c', line 1043

static VALUE EvMultigesture_inspect(VALUE self)
{
    SDL_Event* ev; Data_Get_Struct(self, SDL_Event, ev);
    return rb_sprintf("<%s: type=%u timestamp=%u"
                      " touch_id=%d d_theta=%f d_dist=%f"
                      " x=%f y=%f num_fingers=%d>",
                      rb_obj_classname(self), ev->common.type, ev->common.timestamp,
                      (int)ev->mgesture.touchId, ev->mgesture.dTheta, ev->mgesture.dDist,
                      ev->mgesture.x, ev->mgesture.y, ev->mgesture.numFingers);
}