It would be like this:
floodfill x,y [c]
and it would work like floodfill tool in MS paint. In case of non-closed area, it'll take screen edge as the border.
This will make easier to make polygon-based 3D engines if one wishes to - currently we sure can but either we have to make up our own floodfill function which takes up tokens or have do with wireframes.



Wouldn't it be better to just include a filltri or fillpoly call? Floodfill is a super slow, highlevel function which seems like a departure from the system's "lets make everything feel like the 80s" theme.



yeah trifill might be good.
otherwise it's easy to make your own floodfill, but it's very slow, and with good reason.



Floodfill internal to PICO-8 would be nice. There is a good function to do it fairly quickly:
-- pretty darned fast fill ---- function fill(x,y,c,b) if (b==nil) b=pget(x,y) if pget(x,y)==b then pset(x,y,c) if (x>0) fill(x-1,y,c,b) if (x<127) fill(x+1,y,c,b) if (y>0) fill (x,y-1,c,b) if (y<127) fill (x,y+1,c,b) -- can't use for/next as the -- recursion eats all of stack. -- thanks, cheepicus! end end |
[Please log in to post a comment]