com.jmex.scene
Class TimedLifeController

java.lang.Object
  extended by com.jme.scene.Controller
      extended by com.jmex.scene.TimedLifeController
All Implemented Interfaces:
Savable, java.io.Serializable
Direct Known Subclasses:
LoaderFadeOut, TransitionFadeIn

public abstract class TimedLifeController
extends Controller

TimedLifeController provides an easy mechanism for defining a time-lived controller that receives a percentage to the destination life span and then is removed. For example, if you wanted something to fade-in for your game over 5 seconds you could simply create a TimedLifeController that's life is 5.0f and implement updatePercentage to update the current fade-state of the object up to 1.0f.

Author:
Matthew D. Hicks
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.jme.scene.Controller
RT_CLAMP, RT_CYCLE, RT_WRAP
 
Constructor Summary
TimedLifeController(float lifeInSeconds)
           
 
Method Summary
 void remove()
           
 void reset()
           
 void setPercentage(float percentComplete)
           
 void update(float tpf)
          Defined by extending classes, update is a signal to Controller that it should update whatever object(s) it is controlling.
abstract  void updatePercentage(float percentComplete)
          This method must be implemented for the percentage completion.
 
Methods inherited from class com.jme.scene.Controller
getClassTag, getControllerValues, getMaxTime, getMinTime, getRepeatType, getSpeed, isActive, read, setActive, setControllerValues, setMaxTime, setMinTime, setRepeatType, setSpeed, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimedLifeController

public TimedLifeController(float lifeInSeconds)
Method Detail

update

public void update(float tpf)
Description copied from class: Controller
Defined by extending classes, update is a signal to Controller that it should update whatever object(s) it is controlling.

Specified by:
update in class Controller
Parameters:
tpf - The time in seconds between the last call to update and the current one

remove

public void remove()

reset

public void reset()

setPercentage

public void setPercentage(float percentComplete)

updatePercentage

public abstract void updatePercentage(float percentComplete)
This method must be implemented for the percentage completion. The percentComplete begins at 0.0f and ends at 1.0f.

Parameters:
percentComplete -