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?

P#10264 2015-04-27 20:59 ( Edited 2015-05-29 12:49)

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..

P#10288 2015-04-28 17:21 ( Edited 2015-04-28 21:21)

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

P#10369 2015-04-30 02:54 ( Edited 2015-04-30 06:54)

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.
P#10385 2015-04-30 11:41 ( Edited 2015-04-30 15:44)

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

P#10970 2015-05-28 18:59 ( Edited 2015-05-28 22:59)

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. :)

P#10987 2015-05-29 08:49 ( Edited 2015-05-29 12:49)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-02-06 18:26:14 | 0.007s | Q:18