class: ParticleBurst
[46:7] extends: object
A burst of dots that fly out from the middle of the AGR FXGL window and fade as they go. Build one and call run(). The one thing a caller usually wants to set is how many dots there are, so that is run()'s argument rather than a dial: burst = new ParticleBurst(); burst.run(); // two hundred dots burst.run(1000); // a thousand The dots leave together in every direction, slow down as they travel, and fade to nothing where they stop. The burst clears itself out of the game world once the last dot has gone. The numbers at the top of the class are the dials. Change them to alter the throw, the size of the dots, or how long they burn.
Members
- defaultDots
- minReach
- maxReach
- pixelsPerThrowSecond
- burnSeconds
- minSize
- maxSize
- colors
Methods
-
run (
int Dots = 0)Sets the burst off in the middle of the window. It clears itself out of the game world once the last dot has burned out. Only works inside AGR, which has the FXGL game already running.
- @p
Dotsis how many dots to throw. Left out, it is two hundred. - @r
Entity- the burst, already attached to the game world.
- @p
-
dots ()
How many dots a burst has when run() is not told otherwise.
- @r
int- the count.
- @r
-
total ()
How long the whole burst takes, from the throw to the last dot leaving the world.
- @r
double- the time in seconds.
- @r
-
dotLife (
Index)FXGL asks how long each dot should burn as it spawns it.
- @p
Indexis the dot's number within the burst. - @r
AJavaFX Duration.
- @p