AdamsLair / duality

a 2D Game Development Framework
https://adamslair.github.io/duality
MIT License
1.41k stars 290 forks source link

Tilemap Editor Right-Click Should Erase Previously Painted Tiles #730

Open ilexp opened 5 years ago

ilexp commented 5 years ago

Summary

Accidentally painting a few tiles more than intended happens a lot. It would be awesome if that could be fixed without undoing everything and without one or multiple palette selections: Instead, painting via right-click could "erase" the previously painted tiles by replacing them with the tiles they were painted on top of.

Analysis

cowmanjoe commented 4 years ago

I have a few questions about the desired behaviour of this feature.

I think having complex functionality for this would point to using a new tool. Maybe the tool could be triggered on right click? A problem there would be the preview wouldn't know whether we were erasing or using the selected tool.

ilexp commented 4 years ago

Should right clicking "erase" only the hovered tile, or the entire brush shape?

I'm thinking the entire brush shape.

Should we be able to right click and drag to erase as we would with the brush tool?

Yep, exactly like the brush tool. Overall, the analogy I have in mind is that it's the same brush, but with different colors, so it would behave the same as well.

I think having complex functionality for this would point to using a new tool. Maybe the tool could be triggered on right click?

That would be another option. For simplicity's sake I'd probably go with some behavior integrated in the brush tool itself though - it would also allow right-click to be used context aware per tool, rather than being blocked for all of them.

What exactly is meant by source change and target change? Does this mean tileset and tilemap change?

Source change: I'm selecting different tiles from the palette, pick a tilemap area to copy from, or a different source is assigned via code. Target change: I'm painting on a different tilemap than before.