b2dCyclePalette

Animates an indexed image by rotating a range of its palette entries (classic palette cycling).

2D Overlay

Parameters & Returns

Parameters

imageHandle Int
startIndex Int
endIndex Int
speed Double

Returns

Void

Quick Summary

Animates an indexed image by rotating a range of its palette entries (classic palette cycling).

Technical Exegesis...

Continuously shifts the palette entries from startIndex to endIndex by speed entries per second (negative speed reverses direction), producing flowing water/fire/plasma effects with zero per-frame CPU work on your side. This sets the single cycle for that range; use b2dAddPaletteCycle to stack several cycles. Each image cycles its own palette independently.

Example

Example.bam
b2dCyclePalette(img, 16, 31, 18.0)   ; forward
b2dCyclePalette(img2, 16, 31, -11.0) ; reverse