PICO-8 Wiki
Advertisement
palt( [col,] [t] )
Change the transparency of a color in the draw state for subsequent draw calls.
col
The number of the color to modify.

t
If true, treat this color as transparent. If false, treat this color as opaque.

When the spr(), sspr(), and map() functions copy sprite pixels onto the screen, some colors are considered transparent and are not drawn. By default, color 0 (black) is transparent, so when a sprite's pixel is this color and the sprite is drawn on top of an existing image, that pixel preserves the color underneath.

The palt() function changes the transparency of a given color.

If called without arguments, palt() resets the transparency for all colors. The pal() function called without arguments also resets transparency, though the opposite is not true and palt() will not reset colors.

Examples

-- draw black pixels
palt(0, false)

-- don't draw red pixels
palt(8, true)

-- reset transparency
palt()

-- pal() also resets transparency when it resets colors
pal()

See also

Advertisement