com.WorldLibAndroid
Interface IWorld

All Known Implementing Classes:
BlobWorld

public interface IWorld

An interface which provides methods to let the user manipulate objects in the canvas.

Author:
Christian Herrera

Method Summary
 void draw(ICanvas c)
          With this method the user can draw on the canvas.
 void onGyroscopeEvent(float mGyroX, float mGyroY, float mGyroZ)
          Performs an action when tilting the device by using the gyroscope.
 void onInit(IInit init)
          With this method the user establish the initial values at bigBang.
 void onKeyEvent(int keyCode)
          Performs an action when pressing a key on the keyboard.
 void onOrientationEvent(float mOriX, float mOriY, float mOriZ)
          Performs an action when tilting the device by using the gyroscope.
 void onTick()
          Performs an action on ever tick of the world's clock.
 void onTiltEvent(float mAccelX, float mAccelY, float mAccelZ)
          Performs an action when tilting the device by using the accelerometer.
 void onTouchEvent(int x, int y)
          Performs an action when touching the screen of the device.
 

Method Detail

onTick

void onTick()
Performs an action on ever tick of the world's clock.


onTouchEvent

void onTouchEvent(int x,
                  int y)
Performs an action when touching the screen of the device.

Parameters:
x - coordinate of the touched area.
y - coordinate of the touched area.

onTiltEvent

void onTiltEvent(float mAccelX,
                 float mAccelY,
                 float mAccelZ)
Performs an action when tilting the device by using the accelerometer.

Parameters:
mAccelX - Acceleration minus Gx on the x-axis.
mAccelY - Acceleration minus Gy on the y-axis.
mAccelZ - Acceleration minus Gz on the z-axis. Note: Get more information on Android's Sensors

onGyroscopeEvent

void onGyroscopeEvent(float mGyroX,
                      float mGyroY,
                      float mGyroZ)
Performs an action when tilting the device by using the gyroscope.

Parameters:
mGyroX - Angular speed around the x-axis.
mGyroY - Angular speed around the y-axis.
mGyroZ - Angular speed around the z-axis. Note: Get more information on Android's Sensors

onKeyEvent

void onKeyEvent(int keyCode)
Performs an action when pressing a key on the keyboard.

Parameters:
keyCode - The key code that represents a key. Note: Get more information on KeyEvents

onOrientationEvent

void onOrientationEvent(float mOriX,
                        float mOriY,
                        float mOriZ)
Performs an action when tilting the device by using the gyroscope.

Parameters:
mOriX - Azimuth, angle between the magnetic north direction and the y-axis, around the z-axis (0 to 359). 0=North, 90=East, 180=South, 270=West.
mOriY - Pitch, rotation around x-axis (-180 to 180), with positive values when the z-axis moves toward the y-axis.
mOriZ - Roll, rotation around y-axis (-90 to 90), with positive values when the x-axis moves toward the z-axis. Note: Get more information on Android's Sensors

draw

void draw(ICanvas c)
With this method the user can draw on the canvas.

Parameters:
c - Canvas object to insert the figures to draw in.

onInit

void onInit(IInit init)
With this method the user establish the initial values at bigBang.

Parameters:
init - object where we can establish the initial values.