Category: 2D Overlay
Syntax:
b2dCopyPalette:Void(dstImage:Int, srcImage:Int)
Void
Copies one indexed image's palette onto another.
Takes dstImage (the image to change) and srcImage (the image to take the palette from). Both must be indexed images.
Returns nothing.
This is a copy, not a shared reference. Cycling or fading one image afterwards does not affect the other - which is what makes it useful for giving several sprites a common palette they can then animate independently.
The destination's own stored palette is overwritten, so b2dResetPalette on it afterwards returns it to the palette it was LOADED with, not the copied one.
View detailed documentation online
; Give the second sprite the first one's colours. b2dCopyPalette(sprite2, sprite1)
BambooBasic © 2026 Michael Denathorn