macite / swingame

2D game library accessible from multiple languages
swingame.com
28 stars 9 forks source link

DrawPixel bug (transparency again, yay!) #45

Closed TeaRussell closed 8 years ago

TeaRussell commented 8 years ago

Hey,

Just noticed that when I have a bitmap I've drawn to in a colour other than transparent, and then I set it back to transparent again, it... doesn't change. :( No erasing, basically. (Fairly certain it's a bug, not me, because I've got every other colour working, and it's also not saving as transparent, so it's not a display error.)

Sorry/you're welcome, for keeping on finding pixel bugs!

macite commented 8 years ago

How are you clearing the surface? You need to use ClearSurface to reset it back to transparent.

TeaRussell commented 8 years ago

Wait, you can't just pass it in like the other colours? Oo;; Should I be using ClearSurface just as a matter of course in my loop, then?

macite commented 8 years ago

All of the drawing operations are blended, so drawing a fully transparent pixel/line/shape etc wont have any effect on the bitmap. Clear Surface, however, does change the whole surface to have the passed in color. So Clearing it to transparent, sets all pixels to be transparent.

TeaRussell commented 8 years ago

Huh. Well, I'll go poke at that, then, thank you! :3