Java Reference
In-Depth Information
What you can't see in Figure 9-5 is that the source image for the flare particles is all red. By using the
ColorAdjust , we can set the color to anything at runtime.
I like this effect; I like the way it shows up with the horns in the music.
Wave
This last example uses the bass and the midrange from the song to generate a wave of dots. This again
uses the pattern of particles to generate its effect. Figure 9-6 shows this effect.
Figure 9-6. Wave effect
In Figure 9-6 we can see a number of dots scattered about the screen; when you run the example,
you can see they are being created on the right of the screen and in a straight line go to the left. Each
dot's height on the screen is dictated by the amount of bass in the song when it is created. The color of
the dot is derived from the midrange. Listing 9-11 shows how we did this.
Search WWH ::




Custom Search