Skip to main content
Call ILampArray color functions within the game loop to produce effects and animations. This page shows a few examples. For simplicity, these examples will use ILampArray::SetColor where possible to apply colors to every Lamp on a device. Effects can be produced on individual Lamps or sets of Lamps by using ILampArray::SetColorsForIndices.

Fading and Blinking

Fade lamps in or out by multiplying a color’s RGB values by an increasing or decreasing percentage over a time interval. Create blinking, breathing or flashing effects by repeatedly fading lamps in and out. The following example blinks all Lamps of a LampArray on and off:

Color Cycles

Create color cycles by gradually increasing and decreasing a color’s red, green, and blue values. This will blend between a wide range colors on the RGB spectrum. The following example performs an RGB color cycle on a LampArray.

Position-Based Effects

Use ILampInfo::GetPosition and ILampArray::GetBoundingBox when creating effects that appear to travel across the device, such as ripples or waves. The following example will create a wave of fading out Lamps moving from left to right across the device. Notice that we incorporate the scaling concepts from the “Fading and Blinking” section, but on a per-Lamp basis.

See also

Lighting API Overview ILampArray Reference
Last modified on August 4, 2026