Class: MG::Events::Acceleration

Inherits:
Object
  • Object
show all
Defined in:
motion-game

Overview

This class represents an event received from the accelerometer sensor of the device, usually from the Scene#on_accelerate method.

Properties (collapse)

Instance Attribute Details

- (Float) timestamp (readonly)

Returns the timestamp of the acceleration event.

Returns:

  • (Float)

    the timestamp of the acceleration event.



157
158
159
# File 'motion-game', line 157

def timestamp
  @timestamp
end

- (Float) x (readonly)

Returns the x coordinate of the acceleration event.

Returns:

  • (Float)

    the x coordinate of the acceleration event.



148
149
150
# File 'motion-game', line 148

def x
  @x
end

- (Float) y (readonly)

Returns the y coordinate of the acceleration event.

Returns:

  • (Float)

    the y coordinate of the acceleration event.



151
152
153
# File 'motion-game', line 151

def y
  @y
end

- (Float) z (readonly)

Returns the z coordinate of the acceleration event.

Returns:

  • (Float)

    the z coordinate of the acceleration event.



154
155
156
# File 'motion-game', line 154

def z
  @z
end