Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Xonix floodfilling

Discussion in 'Game Design' started by Kurt-Dekker, May 27, 2022.

  1. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,256
    This is a better forum for the continuation of this thread:

    https://forum.unity.com/threads/xonix-polygons-filling.1287575/

    which was started by @Geckoo but wasn't really relevant to Unity Scripting and was mod-locked.

    @Geckoo asked:

    > how (and when) could I determine the point from which the filling process starts ?

    Read my post here, specifically part 2:

    https://forum.unity.com/threads/xonix-polygons-filling.1287575/#post-8161703

    And for this:

    > How may I be sure that I have a closed polygon ?

    You ALWAYS have a filled polygon: the screen boundaries catch everything.

    The floodfill routine (see Bunny's notes above) can give you the list of cells that constitute an "enclosed area."
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,256