AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkParticleEmitter.AddColorKeyFrame Method (Single, Byte, Byte, Byte, Byte)

Adds a color change at a certain point in a particle's life. For example a color added with Time=1 will make the particle equal the given color when it has been alive for 1 second.

Syntax
Pascal
procedure AddColorKeyFrame(const Time: Single; const Red: Byte; const Green: Byte; const Blue: Byte; const Alpha: Byte = $FF); overload;
Parameters 
Description 
const Time: Single 
The time that particles should become this color. 
const Red: Byte 
The red component of the new color. 
const Green: Byte 
The green component of the new color. 
const Blue: Byte 
The blue component of the new color. 
const Alpha: Byte = $FF 
(optional) The alpha component of the new color, ranging from 0 (fully transparent) to 255 (fully opaque). 

If SmoothColorInterpolation is set to True, the particle will gradually transform from its current color to the next color. For example if you add three colors, red when Time=1, green when Time=2, and blue when Time=3, then the particle will start its life as red (as that is the nearest color) and remain completely red until it is 1 second old. When the particle is between 1 and 2 seconds old it will gradually change from red to green until it is 2 seconds old, at this point it is completely green. When the particle is between 2 and 3 seconds old it will gradually change from green to blue until it is 3 seconds old, at this point it is completely blue. The particle will remain completely blue until the end of its life as no other colors have been added.

Copyright (c) 2012. All rights reserved.