Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Released] PaintCraft (Multiplatform coloring book & drawing app constructor)

Discussion in 'Assets and Asset Store' started by nicloay, May 17, 2016.

  1. unity_iLxAeHlWxpIIXw

    unity_iLxAeHlWxpIIXw

    Joined:
    May 7, 2018
    Posts:
    12
    how do you read the grayscale image and in bucket mode is it possible that just color one part which current position of finger (not color all the parts which has same grayscale color)?
     
  2. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    Grayscale was mandatory parameter before. right now you have to use normal ARGB32 so you will be able to paint any region with the same region color (RGB)
     
  3. unity_iLxAeHlWxpIIXw

    unity_iLxAeHlWxpIIXw

    Joined:
    May 7, 2018
    Posts:
    12
    In which script did you get the touch position(mean how do you know on which portion user want coloring on image)?
     
  4. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    ScreenCameraAndInput generate data for filters. and then in render filter it pass this info to shaders which compare region colors.
     
  5. unity_iLxAeHlWxpIIXw

    unity_iLxAeHlWxpIIXw

    Joined:
    May 7, 2018
    Posts:
    12
    how to convert specific pixel of sprite to mouse position or screen position?
    pivot of the sprite set as bottom left. kindly help me i am facing issue to generate text mesh on sprite.
     
  6. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    I'm sorry. I don't understand the question, can you give me more details please.

    Thanks
    //Nikolay.
     
  7. unity_iLxAeHlWxpIIXw

    unity_iLxAeHlWxpIIXw

    Joined:
    May 7, 2018
    Posts:
    12
    i have specific pixel values of sprite and the sprite pivot set as bottom left. when i instantiate text mesh on specific pixel of sprite then i change the pixel values from screen to world point but it didn't get the right position. when i get the static mouse position and convert the position from screen to world point then it get the right position as you saw in the screenshot. 1 instantiate on the mouse position. so now i want to convert the specific sprite pixel to mouse position and then convert mouse position to screentoworldpoint which get me the exact position. hope fully now you better understand that what i want.
     

    Attached Files:

  8. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
  9. hanniiel

    hanniiel

    Joined:
    Jun 14, 2013
    Posts:
    39
    Hello there,
    there's a problem with the tool on IOS, it seems to be okay on Android but when I build on IOS the backlayer is black and allows me to paint but the color set as BG is not the color set and when the clean bucket is broken as well.
    I'm using the last update
     
  10. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    Hello please disable metal for ios. and use just opengles2

    Remove selected row
    upload_2019-2-1_22-5-29.png
     
    hanniiel likes this.
  11. hanniiel

    hanniiel

    Joined:
    Jun 14, 2013
    Posts:
    39
    Thank you very much, btw there´s a problem with the redo/undo function, when i paint 2 lines then clean and undo only redo`s one movement and the other gets ignored!

    There's one more question, we're working on something to scale and rotate stickers, to customize the experience of the tool, but we are having some difficulties with this. Is there a way to do it with the plugin?, we were testing DrawingGameObjectController but when we resize the brush the sticker keeps the same size.

    Thanks in advance
    Haniel A.
     
    Last edited: Feb 1, 2019
  12. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    Please check this page https://docs.paintcraft.in/tool-pipeline.html and then try to insert scale filter from any another brush.
     
  13. hanniiel

    hanniiel

    Joined:
    Jun 14, 2013
    Posts:
    39
    thanks it worked, may I ask how can I use the rotate filer outside without a random value?

    I'm trying to set it directly on the drawingObj like this:
    ScreenCameraController.ContinueLine(LineId, transform.position);
    BrushContext bc = PaintcraftGesture.ContextByLineId[LineId];
    bc.ForEachUncopiedToCanvasPoint(PointType,
    point => point.Rotation = Random.Range(0, 360));
    but is not working.
    thanks in advance.
    best regards
     
  14. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    I haven't done that before. I use filters everytime when I need to make any point adjustments.
    And please find that brushcontext has 2 collection basepoints (which come from input) and interpolated points, so if you do any adjustments before interpolation you usually modify base points value, otherwise interpolated.
     
  15. chris1P

    chris1P

    Joined:
    Aug 20, 2013
    Posts:
    7
    Hi. Do you have any plans to support Metal? OpenGL ES is becoming deprecated so we are trying to ensure that we are using Metal for everything going forward.
     
  16. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    Hello @chris1P, Metal works on 2017.x.x the problem is only on the unity 2018.
    Just tried to build again on 2017.4.20f1 - there was no any issue with metal render
    upload_2019-2-23_9-40-23.png
     
  17. chris1P

    chris1P

    Joined:
    Aug 20, 2013
    Posts:
    7
    Ah, should have mentioned we are using 2018, and that is out of our control.
     
  18. zhengying

    zhengying

    Joined:
    Nov 21, 2015
    Posts:
    12
    hi @nicloay
    Is any plan to support unity 2018 (metal broken)?
    PaintCraft hasn't been updated for a year, Will it be maintained in the future?
     
  19. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    @zhengying Yes. I'm planning new release in April and hope to fix problem with metal on 2018
     
    chris1P likes this.
  20. zhengying

    zhengying

    Joined:
    Nov 21, 2015
    Posts:
    12
    @nicloay I'm glad to hear that. thanks for your hard work!
     
    chris1P likes this.
  21. payalzariya07

    payalzariya07

    Joined:
    Oct 5, 2018
    Posts:
    62
    hello
    I am using Paintcrft pro asset .
    but problem with confetti brush. it draw backlayer and outlayer.
    can you tell me how to setup confetti brush ?
    Screen Shot 2019-03-15 at 3.59.14 PM.png
     
  22. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    I'm sorry, do you want to render confetti on top of the black lines? (if yes, i'm afraid it's not possible as the confetti is standard brush which render swatches on the background layer.
     
  23. payalzariya07

    payalzariya07

    Joined:
    Oct 5, 2018
    Posts:
    62
    No i am not drawing render in top of the black line but confetti brush behavior like spray brush. using confetti brush drawing like spray.
     
  24. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    can you check following page https://docs.paintcraft.in/tool-pipeline.html it explain how to adjust tool pipeline
     
  25. KVinS

    KVinS

    Joined:
    Aug 27, 2013
    Posts:
    8
    Hello.
    How can I make a saving with a transparent layer?

    It's right?

    Code (CSharp):
    1.         IEnumerator DoSaveChangesToDisk()
    2.         {
    3.             yield return new WaitForEndOfFrame();
    4.             RenderTexture tmp = RenderTexture.active;
    5.             RenderTexture.active = BackLayerController.RenderTexture;
    6.  
    7.             TmpTexture2D.ReadPixels(new Rect(0,0,BackLayerController.RenderTexture.width, BackLayerController.RenderTexture.height),0,0,false );
    8.          
    9.             File.WriteAllBytes(SaveFilePath, TmpTexture2D.EncodeToPNG());
    10.  
    11.             //RenderTexture downscaledRT = RenderTexture.GetTemporary(440, 330);
    12.             //Graphics.Blit(CanvasCameraController.Camera.targetTexture, downscaledRT);
    13.             //RenderTexture.active = downscaledRT;
    14.  
    15.             TmpTextureIcon2D.ReadPixels(new Rect(0, 0, 440, 330), 0, 0, false);
    16.             File.WriteAllBytes(PageConfig.IconSavePath, TmpTextureIcon2D.EncodeToPNG());
    17.             //RenderTexture.ReleaseTemporary(downscaledRT);
    18.             RenderTexture.active = tmp;
    19.         }
    I do not like that you can not draw points - only lines.

    It is worth adding more flexible settings for autosave. For example, if I want to use the "clean sheet" template and make several save slots.
     
    Last edited: Mar 24, 2019
  26. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    hello @KVinS,
    Yes, if BackLayerController.RenderTexture in format which support transparency this code should work.

    To draw points, I think you can try to remove "RemoveDuplicatte" filter from the brush pipeline
    About autosave - yes, I agree, I'll check what I can do there.
     
  27. ExcellencyHong

    ExcellencyHong

    Joined:
    Aug 9, 2016
    Posts:
    22
    it is so weird for writing characters.
    i made a ipad pro app which has a function to write a message.

    when i draw curved line or long draw continuously, it seem to works fine. but draw short and variable direction like characters, some stroke is lost.

    my guess, it is not relate with performance.

    in my opinion, it happens the moment that draw quickly new line different direction with previous line.
     
  28. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    @ExcellencyHong, I use spline interpolation for line drawing, so it require at least 3 points to draw a smooth line. And also you can find in brush pipeline that first filter remove duplicates.

    When device send input position to the unity it do that only one time per frame. that means that if you move your finger very quickly some of those points will be missed. and also you need to understand that frame rate affect the number of collected points directly.
    Also when you draw several lines in a row paintcraft can save undo layers to the disk - it take some time so at this point app is frozen and don't collect points as well. In this case Undo/Redo behaviour must be completely be rewritten (to avoid i/o to the disk).

    Can you check please what is your average fps when you face the issue. and could you also provide screenshot of the lines which

    Also. try to open CanvasController.cs and change following 2 methods to these
    Code (CSharp):
    1. public void SaveChangesToDisk()
    2.         {
    3.             StopAllCoroutines();
    4.             StartCoroutine(DoSaveChangesToDisk());
    5.         }
    6.  
    7.            
    8.  
    9.         IEnumerator DoSaveChangesToDisk()
    10.         {
    11.             yield return new WaitForSeconds(1f);
    12.             RenderTexture tmp = RenderTexture.active;
    13.             RenderTexture.active = BackLayerController.RenderTexture;
    14.            
    15.             TmpTexture2D.ReadPixels(new Rect(0,0,RenderTextureSize.x, RenderTextureSize.y),0,0,false );
    16.            
    17.             File.WriteAllBytes(SaveFilePath, TmpTexture2D.EncodeToJPG(100));
    18.  
    19.             RenderTexture downscaledRT = RenderTexture.GetTemporary(440, 330);
    20.             Graphics.Blit(CanvasCameraController.Camera.targetTexture, downscaledRT);
    21.             RenderTexture.active = downscaledRT;
    22.  
    23.             TmpTextureIcon2D.ReadPixels(new Rect(0, 0, 440, 330), 0, 0, false);
    24.             System.IO.File.WriteAllBytes(PageConfig.IconSavePath, TmpTextureIcon2D.EncodeToJPG(100));
    25.             RenderTexture.ReleaseTemporary(downscaledRT);
    26.             RenderTexture.active = tmp;
    27.         }
    You can see here that it save snapshot and icon with 1 second lag
     
  29. amit232

    amit232

    Joined:
    Jul 14, 2017
    Posts:
    1
    Hi,

    How is it going with the update? We are working to launch a game in the next few days. If we dont get an update soon, we will have to consider other options. Is there a tentative date by which we can get support for the plugin in Unity 2018?
     
  30. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    Hello I have working prototype right now. but final version will be avialble only in April, 15-20.
     
  31. payalzariya07

    payalzariya07

    Joined:
    Oct 5, 2018
    Posts:
    62
    How to set Full screen drawing page ?
     
  32. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    I suppose you need to create BlankPageConfig runtime and set the size according to Screen.Width and height. in it.
    Please let me know if you still have some questions.

    Thanks.
     
  33. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    216
    Hi, can it be saved after painted and which saved format is available?Cause in my game players could save their paintings and that could be renewed. Thanks very much,
     
  34. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    Hello https://docs.paintcraft.in/qookbook/saveimage.html here you can find how to save result image to PNG/JPG
    Please let me know if you will have any questions.

    thanks.
     
  35. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    216
    Yeah, it is just like saving to a gallery,and it could be saved ,re-painted and shared, in my opion, it should not be saved in jpg,cause it would not be available for re-paiting nor shared painting, and as mentioned in page aboved,this function is not in the develop plan. Is this will be developed in futher? Thanks very much
     
  36. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    Hello. I already implemented that in to my development branch. And hope to release it soon (in 7-10 days). My main effort right now is to make everything works on unity 2018.
     
  37. omechano

    omechano

    Joined:
    Sep 12, 2014
    Posts:
    22
    Hey just want to let you know its an awesome plugin that you have. I am eagerly awaiting for the 2018 release.

    Thanks,
    Umar
     
    nicloay likes this.
  38. jung-hyun-jong

    jung-hyun-jong

    Joined:
    Feb 21, 2015
    Posts:
    3
    Hi.



    I made a project using paintcraft now.



    The content of the project is to create a guestbook on the monitor using a Windows pen.



    The problem is that after I build Unity, when I write a guest book using a Windows pen, when I try to write with the Windows pen, the text is broken.



    I am curious about which option to change.



    Should I change the Spacing option of the LineConfig script?



    If it is due to the spacing option, should I raise this value? Should I lower?



    I can not solve this problem well.



    I will wait for your reply.



    Thank you.



    p.s - I am now using the InkTool brush in the LineConfig script, using black for color, 1 for spacing, 0.25 for scale, and None for texture.
     
  39. jung-hyun-jong

    jung-hyun-jong

    Joined:
    Feb 21, 2015
    Posts:
    3
    I sent a question by e-mail, but I do not have a reply and I just write it here.
     
  40. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    @jung-hyun-jong,
    Thanks for your info but can you provide screenshot please. I'm not following the problem.

    Thanks.
     
  41. jung-hyun-jong

    jung-hyun-jong

    Joined:
    Feb 21, 2015
    Posts:
    3
    There is no picture and there is video. Can I check if I can send it by email? email sent.
     
  42. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    Hello Everyone. I have some problem with submission but new paintcraft version is ready and if someone urgently need 2018 metal support please send me your invoice id to support@paintcraft.in and I'll share RC version by email.

    p.s. Also starting from 2.3 version I'll drop support for all page configs but StreamingAssets, so all page configs will depends to the plain PNG files and the final build size of the app will be much smaller.

    Thanks.
     
  43. omechano

    omechano

    Joined:
    Sep 12, 2014
    Posts:
    22
    Hi @nicloay .

    I wanted to create a tool which I could use to mass colour regions. For example I swipe my finger over the regions and they get filled.

    Please guide me on how to do that.

    Thanks,
    Umar
     
  44. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
  45. omechano

    omechano

    Joined:
    Sep 12, 2014
    Posts:
    22
    @nicloay I don't understand. Can you make me this control ?
     
  46. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    @omechano, I'm sorry next 2 weeks im very busy, but starting May 5 you can hire me to make this customization. for further details please drop me the mail to support@paintcraft.in.
     
  47. omechano

    omechano

    Joined:
    Sep 12, 2014
    Posts:
    22
    Hi @nicloay. I am facing an issue with the colouring. I am getting white stains at the edges of the strokes. Please see attached files.

    Please fix this bug and / or recommend a solution.

    Thanks,
    Umar
     

    Attached Files:

  48. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    This is a common problem. What you have to do is just to make your regions overlap lines a little bit. Or use filterMode = point when you paint your regions and in the paintcraft also.
     
  49. MrFigment

    MrFigment

    Joined:
    Jan 5, 2017
    Posts:
    25
    Hi @nicloay, in Unity 2019.1.0f2 I have a problem with the InputController script, it has big lag spikes when I paint.
    We have been using this asset more than a year ago, and worked very well

     
  50. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    480
    MrFigment likes this.
unityunity