Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Slice 2D transparent image with multiple elements inside

Discussion in '2D' started by usernameHed, Jun 5, 2021.

  1. usernameHed

    usernameHed

    Joined:
    Apr 5, 2016
    Posts:
    90


    Hello! I am creating some sort of runtime generator, and I have one specific problem:

    For a given image in input (a png like that), I would like to be able to separate the shape inside the it, to get the number of individual element I can find (here it would find 15 different element).

    Then, I would like to be able do display or hide each element separatly (maybe just create an png image as output, with just X elements (like the image bellow).

    What would be my approach to this ?

    Thanks!
     

    Attached Files:

    • 1.png
      1.png
      File size:
      9.8 KB
      Views:
      196
    • 2.png
      2.png
      File size:
      7.3 KB
      Views:
      199
    • 3.png
      3.png
      File size:
      10.7 KB
      Views:
      198
    • 4.png
      4.png
      File size:
      8.7 KB
      Views:
      200