yellowstonegames / SquidLib

Useful tools for roguelike, role-playing, strategy, and other grid-based games in Java. Feedback is welcome!
Other
454 stars 46 forks source link

Can't set individual panels' erase color #165

Closed SquidPony closed 7 years ago

SquidPony commented 7 years ago

Working with multiple panels requires manually drawing each cell on each (that's not the default background color) one to the background color desired. Since erase() is meant to be the means to avoid doing exactly that, this seems odd.

tommyettinger commented 7 years ago

I'm rather confused by this whole issue. There's no "erase color" other than transparent, and the whole point of erasing is to remove color and char info. The background colors of cells in a SquidLayers are the background SquidPanel's color values, where the cells all have a special control char to indicate they should be drawn with a solid block. I think erase() does what it's supposed to if you call it on a SquidPanel; it makes all chars the space char (unrendered) and makes all colors transparent. If you call erase() on a whole SquidLayers, though, you are erasing all of the info for chars and colors in all panels it has; it doesn't hold on to some of the stuff you told it to erase and get rid of other parts. You may want mySquidLayers.eraseLayer(1); where 1 means only the foreground layer.

The default background color for a SquidLayers is transparent. You may mean the clear color, which is the color of the screen behind the SquidLayers.

I'm somehow more confused after re-reading this 3-sentence issue. I really don't know what on Earth you are trying to do. Closing now; will reopen if you explain this clearly.

SquidPony commented 7 years ago

You are correct, mySquidLayers.eraseLayer(1) was more what I was expecting. Given the answer in the related issue, I see now that this wasn't really a bug after all.