Edit: Found a solution online while researching Flood Filling thanks to actual
I'm currently working on a level editor for an Android game. My goal is to add cool tools such as:
- pencil: Add single textures to the grid
- eraser: remove texture from grid
- bucket: fill in neighbor textures
I can't seem to find any tutorials on how to fill in an arbitrary geometric area for the bucket tool. I'm not necessarily looking for source code, I just can't seem to figure out how to go about filling in parts of a 2d array. I've considered using path-finding techniques, but I feel there may be a simple solution. Here is an image of what I'm dealing with:
I've created many level editors in the past, but never played around with the bucket tool idea. If you have any thoughts, please post about it; I'm sure other people would like to know how to do this as well. Thanks in advance!