C4 Engine
C4 Engine API Documentation

class PulsateSprocket

Defined in:  C4Sprockets.h
The PulsateSprocket class causes one of a widget's colors to pulsate.
Definition

class PulsateSprocket final : public Sprocket

Constructor

PulsateSprocket(const ColorRGBA& color, int32 wave, float frequency, float phaseShift = 0.0F);

Parameters
color The pulsate color. The widget color varies between its original value and this color.
wave The type of waveform. See below for possible values.
frequency The pulsate frequency, in full periods per millisecond.
phaseShift The phase shift, in units of full periods. This should be in the range [0, 1).
Description
The PulsateSprocket class varies the color of a widget back and forth between its original value and the color specified by the color parameter. The interpolation can be based on one of the following types of waves specified by the wave parameter.
kPulsateWaveSquare A square wave. The value is 0.0 for the first half of each cycle and 1.0 for the second half.
kPulsateWaveTriangle A triangle wave. The value varies linearly from 0.0 to 1.0 in the first half of each cycle and back to 0.0 in the second half.
kPulsateWaveSine A sine wave. The value varies as a sinusoid from 0.0 to 1.0 in the first half of each cycle and back to 0.0 in the second half.
Base Classes
Sprocket A PulsateSprocket is a specific type of sprocket.