|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.util.Phaser
public abstract class Phaser
Provides a convenient way to effect updates that proceed through a set of discrete phases (for example: fade in, linger, fade out). Updates are always generated for phase end boundaries. For example, if there are two phases (0.5, 0.5) and 10.0 seconds elapse, one update is generated for the end of the first phase and one is generated for the end of the second phase.
| Field Summary | |
|---|---|
protected float |
_accum
The time accumulated towards the next phase. |
protected float |
_cpct
The complement of the percentage completed ( 1f - _pct). |
protected float[] |
_durations
The durations of each phase. |
protected Method[] |
_methods
The methods for each phase. |
protected float |
_pct
The percentage of the current phase completed, from zero to one. |
protected int |
_phase
The index of the current phase. |
| Constructor Summary | |
|---|---|
Phaser(Object... params)
Creates a new phaser. |
|
| Method Summary | |
|---|---|
protected void |
completed()
Called when the last phase is completed. |
void |
tick(float elapsed)
Updates the state of this object based on the elapsed time in seconds. |
protected void |
update(int phase,
float pct)
Performs an update for the indexed phase. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Method[] _methods
protected float[] _durations
protected int _phase
protected float _accum
protected float _pct
protected float _cpct
1f - _pct).
| Constructor Detail |
|---|
public Phaser(Object... params)
params - the names of the update methods to call for each phase and their corresponding
phase durations (example: "fadeIn", 1f, null, 2f, "fadeOut", 1f). Update
methods should be member methods with zero arguments.| Method Detail |
|---|
public void tick(float elapsed)
Tickable
tick in interface Tickable
protected void update(int phase,
float pct)
pct - the percentage of the phase completed, from zero to one.protected void completed()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||