LiveSpringPanel Class Reference

Panel that vibrates a child widget according to the acceleration sensor or panel movement. More...

Inheritance diagram for LiveSpringPanel:
Panel ContainerWidget Widget

List of all members.

Public Member Functions

 LiveSpringPanel ()
 Constructor.
override void AddChildFirst (Widget child)
 Adds the child widget to the beginning.
override void AddChildLast (Widget child)
 Adds the child widget to the end.
override void InsertChildBefore (Widget child, Widget nextChild)
 Inserts it immediately in front of the specified child widget.
override void InsertChildAfter (Widget child, Widget prevChild)
 Inserts it immediately after the specified child widget.
override void RemoveChild (Widget child)
 Deletes the specified child widget.
void SetDampingConstant (Widget widget, SpringType type, float dampingConstant)
 Sets the spring damping constant (the speed until the vibration converges).
float GetDampingConstant (Widget widget, SpringType type)
 Obtains the spring damping constant (the speed until the vibration converges).
void SetSpringConstant (Widget widget, SpringType type, float springConstant)
 Sets the spring constant (the strength at which the spring tries to return to its original position).
float GetSpringConstant (Widget widget, SpringType type)
 Obtains the spring constant (the strength at which the spring tries to return to its original position).
void SetDisplacement (Widget widget, SpringType type, float displacement)
 Sets the spring displacement (the deviation from the default position).
float GetDisplacement (Widget widget, SpringType type)
 Obtains the spring displacement (the deviation from the default position).
void AddAcceleraton (float x, float y, float z)
 Adds the acceleration to the child widget.

Protected Member Functions

override void OnUpdate (float elapsedTime)
 Update processing.
internal override void OnMotionEvent (MotionEvent motionEvent)
 Motion event handler.

Properties

bool ReflectSensorAcceleration [get, set]
 Obtains and sets whether to apply the acceleration sensor value to the child widget movement.
bool ReflectMotionAcceleration [get, set]
 Obtains and sets whether to apply the panel movement to the child widget movement.

Detailed Description

Panel that vibrates a child widget according to the acceleration sensor or panel movement.


Member Function Documentation

void AddAcceleraton ( float  x,
float  y,
float  z 
)

Adds the acceleration to the child widget.

Parameters:
xAcceleration in the X-axis direction
yAcceleration in the Y-axis direction
zAcceleration in the Z-axis direction
override void AddChildFirst ( Widget  child) [virtual]

Adds the child widget to the beginning.

Parameters:
childChild widget to be added

Moves it to the beginning if it has already been added.

Reimplemented from ContainerWidget.

override void AddChildLast ( Widget  child) [virtual]

Adds the child widget to the end.

Parameters:
childChild widget to be added

Moves it to the end if it has already been added.

Reimplemented from ContainerWidget.

float GetDampingConstant ( Widget  widget,
SpringType  type 
)

Obtains the spring damping constant (the speed until the vibration converges).

When this value is between 0 and 1, the larger the value, the shorter the time until the vibration converges. Default is 0.2.

Parameters:
widgetWidget that obtains the damping constant
typeType of spring that obtains the damping constant
float GetDisplacement ( Widget  widget,
SpringType  type 
)

Obtains the spring displacement (the deviation from the default position).

Parameters:
widgetWidget for obtaining the displacement
typeType of spring that obtains the displacement
float GetSpringConstant ( Widget  widget,
SpringType  type 
)

Obtains the spring constant (the strength at which the spring tries to return to its original position).

The vibration decreases as the value between 0 and 1 increases. Default is 0.3.

Parameters:
widgetWidget that obtains the spring constant
typeType of spring that obtains the spring constant
override void InsertChildAfter ( Widget  child,
Widget  prevChild 
) [virtual]

Inserts it immediately after the specified child widget.

Parameters:
childChild widget to be inserted
prevChildChild widget immediately in front of the inserted child widget

Moves it immediately after the specified child widget if it has already been added.

Reimplemented from ContainerWidget.

override void InsertChildBefore ( Widget  child,
Widget  nextChild 
) [virtual]

Inserts it immediately in front of the specified child widget.

Parameters:
childChild widget to be inserted
nextChildChild widget immediately after the inserted child widget

Moves it immediately in front of the specified child widget if it has already been added.

Reimplemented from ContainerWidget.

internal override void OnMotionEvent ( MotionEvent  motionEvent) [protected, virtual]

Motion event handler.

Parameters:
motionEventMotion event

Reimplemented from Widget.

override void OnUpdate ( float  elapsedTime) [protected, virtual]

Update processing.

Parameters:
elapsedTimeElapsed time from previous update (ms)

Reimplemented from Widget.

override void RemoveChild ( Widget  child) [virtual]

Deletes the specified child widget.

Parameters:
childWidget to be deleted

Reimplemented from ContainerWidget.

void SetDampingConstant ( Widget  widget,
SpringType  type,
float  dampingConstant 
)

Sets the spring damping constant (the speed until the vibration converges).

When this value is between 0 and 1, the larger the value, the shorter the time until the vibration converges. Default is 0.2.

Parameters:
widgetWidget that sets the damping constant. Changes the damping constant of all the widgets when null is specified.
typeType of spring that sets the damping constant. Changes the damping constant of all the springs when SpringType.All is specified.
dampingConstantDamping constant
void SetDisplacement ( Widget  widget,
SpringType  type,
float  displacement 
)

Sets the spring displacement (the deviation from the default position).

Parameters:
widgetWidget for setting the displacement
typeType of spring that sets the displacement
displacementDisplacement
void SetSpringConstant ( Widget  widget,
SpringType  type,
float  springConstant 
)

Sets the spring constant (the strength at which the spring tries to return to its original position).

The vibration decreases as the value between 0 and 1 increases. Default is 0.3.

Parameters:
widgetWidget that sets the spring constant. Changes the spring constant of all the widgets when null is specified.
typeType of spring that sets the spring constant. Changes the damping constant of all the springs when SpringType.All is specified.
springConstantSpring constant