How to recognize the coverage in specific area by drawing stroke?

Hi everyone,
I am a junior game developer.

Recently, I want to make a game to draw something in specific area.
If the area is filled by stroke of drawing, it will show the icon of success.
(The gray font is specific area. If the blue stroke fill this,the game will show icon.)

I find the relational plug-ins in unity asset store.

But I don’t know how to recognize the coverage in specific area by drawing stroke.

Can anybody help me about this issue?

how accurate it should be? like what if user leaves 1-2 pixel gaps to that line?

some ideas to try

  • place invisible colliders inside that gray area, and then during drawing you “collect” them, and need to collect all of most of them to be complete
  • divide gray area into grid (larger than pixels), user need to visit enough grid cells
  • if its mesh shape, or mesh/polygon collider, maybe works if need to draw near enough each vertex (“mark each vertex position visited”)
  • divide image to lines (horizontal and or vertical also), user needs to intersect each line
    8635692--1161270--upload_2022-12-5_10-5-24.png
1 Like

mgear,I apperaciate your idea very much.
I will try this method in my unity project.
Thx:)