unitycoder / UnityMobilePaint

Public repository for MobilePaint issues & requests
https://www.assetstore.unity3d.com/en/#!/content/19803?aid=1101lGti
MIT License
51 stars 16 forks source link

how do I know the number of areas to shade on one image ? #54

Open congdt7 opened 3 years ago

congdt7 commented 3 years ago

how do I know the number of areas to shade on one image

unitycoder commented 3 years ago

see example scene "scene_MobilePaint_LockingMaskWithAreaCalculation" then paint or fill into some area, see console log for the pixel count, then you need use those values inside PaintAreaEventListener.cs (see the example values there used)

congdt7 commented 3 years ago

sample_shapes Like this picture, how do I know there will be 7 shading areas for this image? In the PaintAreaEventListener.cs we only see the log with Debug.Log("Get fullArea: " + fullArea + " | filledArea: "+ filledArea + " | percentageFilled: "+ percentageFilled); fullArea is an area of ​​the need fill color. I want to know the number need file before start fill the color.

unitycoder commented 3 years ago

you need to manually fill it, then see from debug log the total amount, then use those values in the script. (they need to be unique values, cannot have 2 shapes with same pixel count)