Log In  


I noticed that using

pal(x, 0)

draws x as black instead of transparent.
Is there a way to remap a color to transparent?
is the above supposed to and just broken?



This is the intended behavior, as it can be used to draw black pixels in sprites.

I didn't consider the need to remap to transparency though. perhaps pal(x, 16)?
Let me think about that..


I've used the remap-to-black feature, but this could be handy too. Maybe pal(x, -1) would be more intuitive?


What about a way to set which color in the pallet is considered the transparent one?

mask()   -- sets color 0 as the mask color (default)
mask(4)  -- sets color 4 as the mask color.

Still wondering what I can do about this problem, does anyone have a creative solution?


I guess there is no easy way till the pal() function is changed. :(
But a couple of workaround ideas:

  • Copy the sprite pixel-by-pixel, and leave out the transparent ones.
  • Or maybe the other way: draw the sprite without transparency, and draw the background over the black pixel-by-pixel (provided you know what should be behind)
  • Use solid black background, so the black pixels will be "transparent" (Or you can do this with any other colors.)
  • Do you absolutely need to change a sprite color to transparent from code? Come up with a different requiroment. :)

Not really elegant solutions, but that's the nature of workarounds. :)



[Please log in to post a comment]