ScratchData LogoScratchData
Back to Bargonaut's profile

flood-fill

BABargonaut•Created January 2, 2009
flood-fill
61
55
3386 views
View on Scratch

Instructions

This program demonstrates how to fill a closed shape with a color. Even around holes! Draw a shape and press the 'f' key while pointing inside it. It will fill the white area with the current color. I added white (for erasing) but it won't fill with the background white color. NOTE: This algorithm broke with Scratch 2.0, but you can get an idea of how it works by holding down 'f' and moving the mouse.

Description

Flood Fill Example: It uses the "scanline with stack" flood fill algorithm, which is explained here -- http://lodev.org/cgtutor/floodfill.html Enjoy.

Project Details

Project ID368844
CreatedJanuary 2, 2009
Last ModifiedMay 22, 2016
SharedJanuary 2, 2009
Visibilityvisible
CommentsDisabled