How to use Drawing Canvas Pluging to show javascript Chart from CanvasJS

From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • Hi All , I have been trying to make this work but with no success , if you know how to use the code bellow using the pluging Drawing canvas , can you help me ?

    I used the example : Drawing Canvas Generate image , But I cant figure it out. ( Im not a programmer )

    Tagged:

  • Here is an example showing how you could do it.

    dropbox.com/s/oxxg1rstsju2rmv/DrawingCanvasCanvasJS.c3p

    The script creates an element for the library to use and makes sure it is hidden. Then sends it to the library, does the rendering and finally extracts the results from it's "canvas" property into the drawing canvas plugin instance.

    There is a little caveat to the whole process though. The drawing canvas is not available for use through the scripting API until at least 1 tick has passed, so the script in the example makes sure to wait for that.

    Hopefully we will sort that out sometime in the near future, but until then you'll have to do with the little hack.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • DiegoM

    Amazing Job ! Thanks a lot !

    I think this example must be in the examples page in scripts , because i think this is a commom question how to display javascript using c3 canvas and manipulate it .

    I have been using iframe for it and its not the same thing.

    Thanks a lot again !

  • DiegoM

    Sorry to disturbing you !

    Now Im trying to load a simple image like :

    img.src = "https://cdn.pixabay.com/photo/2021/08/20/23/49/plant-6561467_960_720.jpg";

    and "./myimage.jpg"; from files not using any libraries , Into drawing canvas , but without success , any tip ?

    Thanks

  • An easy way of doing it without scripting is to use the Load image from URL action on a Sprite instance.

    When that is loaded, you can use the Paste object action of Drawing Canvas to copy the image data over.

    After that you can get rid of the sprite instance.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)