com.jme.util.stat.graph
Class DefColorFadeController
java.lang.Object
com.jme.scene.Controller
com.jme.util.stat.graph.DefColorFadeController
- All Implemented Interfaces:
- Savable, java.io.Serializable
public class DefColorFadeController
- extends Controller
A controller that changes over time the alpha value of the default color of a
given Geometry. When coupled with an appropriate BlendState, this can be used
to fade in and out unlit objects.
An example of an appropriate BlendState to use with this class:
BlendState blend = DisplaySystem.getDisplaySystem().getRenderer()
.createBlendState();
blend.setBlendEnabled(true);
blend.setSourceFunction(SourceFunction.SourceAlpha);
blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha);
- Author:
- Joshua Slack
- See Also:
- Serialized Form
Method Summary |
void |
update(float time)
Defined by extending classes, update is a signal to
Controller that it should update whatever object(s) it is controlling. |
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 |
DefColorFadeController
public DefColorFadeController(Geometry target,
float targetAlpha,
float rate)
- Sets up a new instance of the controller. The
- Parameters:
target
- the object whose default color we want to change the alpha on.targetAlpha
- the alpha value we want to end up at.rate
- the amount, per second, to change the alpha. This value will
be have its sign flipped if it is not the appropriate
direction given the current default color's alpha.
update
public void update(float time)
- 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:
time
- The time in seconds between the last call to update and the
current one