Log In  

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.

P#13515 2015-09-01 18:47 ( Edited 2018-10-13 15:37)

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.

P#13546 2015-09-02 01:54 ( Edited 2015-09-02 05:54)

yeah trifill might be good.

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

P#13547 2015-09-02 02:56 ( Edited 2015-09-02 06:56)

+1 for floodfill and/or fillpoly

P#13551 2015-09-02 05:56 ( Edited 2015-09-02 09:56)

Polygon with N sides, please!

P#57908 2018-10-13 07:24 ( Edited 2018-10-13 11:24)

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
P#57910 2018-10-13 11:37 ( Edited 2018-10-13 15:37)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-18 22:07:20 | 0.008s | Q:16