[PLUGIN] Canvas

2 favourites
From the Asset Store
Pixel Destruction like in "Worms" (Drawing Canvas based)
  • milengk : put a layer on top of the canvas, with the outlines black, and everything else transparent.

  • The problem is if you color the outlines, then you can color couple parts with one click. A copy of outlines on top doesn't help.

  • Try sampling the color of the pixel with the expression rgbaAt(x,y) before flood filling.

  • It works perfect, thanks ROJOhound.

  • Can the 'SVG CANVAS' object be pasted into the Canvas plugin?

  • chrisbrobs : I need to add a "export to base64 string" to the SVG to do that, but I think it's possible.

  • Where do I input the expression rgbaAt(x,y) before flood filling to sample the pixel color?

  • Hmm, I needed something like this and this plugin seems great - however I can not get it to work :(

    I installed the plugin, used it in an empty project, but none of its actions work. Tried rotating it, setting opacity, clearing it, drawing a line, and fill/floodfill - nothing happens in either case.

    I also tried Pode's cat painting tutorial (both capx and from the provided link), and the floodfill he uses works but the whole result behaves rather strangely:

    • initial color is grey, and painting with grey works
    • changing color to pink or brown works, but only if you use those colors first
    • using any of the other colors first switches to black, and makes it impossible to use pink/brown anymore (everything's black)
    • the CPU usage remains around 25% for me, but it keeps eating up RAM continuously until crashing the browser (both Chrome and FF)

    I turned WebGL off as you guys said it might cause problems.

    Any ideas as to what might be causing this?

    Seems like a rather powerful plugin, but since it works ok to so many people I wonder if there's something seriously wrong on my side (everything else in Construct works fine though).

    Cheers!

    D.

    Edit: I shut down Construct, remade a fresh project, put in only Canvas and Mouse, and now all the actions are working fine - in that project.

    The cat painting example however is still acting up and taking up RAM uncontrollably until crash (and still accepting only pink and brown).

    I'll leave the symptoms here just in case, maybe it's something worth looking into?

  • The increasing ram usage is caused when using webgl. Internally the plugin still uses canvas2d and with webgl a new texture of the canvas is made every frame causing the memory leak. I need to re-write it properly use webgl in an efficient manner.

  • R0J0hound

    I use canvas plugin in my cool down mask behavior.

  • The increasing ram usage is caused when using webgl. Internally the plugin still uses canvas2d and with webgl a new texture of the canvas is made every frame causing the memory leak. I need to re-write it properly use webgl in an efficient manner.

    Using 'int(Mouse.X-Canvas2.X)' instead of the standard Mouse.X-Canvas2.X

    inside events seems to stop any slowdowns crashes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am using the canvas plugin to capture a rectangular selection of an image....

    then 'Canvas.imageUrl' to save the rectangle.

    Everything works as expected...but the captured rectangle resizes to its original size in the new browser window.

    The following screen captures might illustrate it better-

    <img src="https://dl.dropbox.com/u/22173473/canvashelp.png" border="0" />

    Any idea how to fix this?

  • If you changed the size of the canvas with events the canvas will still have the size it had at edit time internally. This is by design and has it's uses. Use the "resize canvas" action to counteract it.

  • Thanks ROJOhound...tested and working.

    <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Question:

    Is there a difference between drawing a path or drawing multiple lines between points if rendering is concerned?

    I'm fooling around with an animated version of connect the dots but can't get my fps over 20..

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