How do I get this smooth drawing in any speed of cursor?

  • Hi,

    Please see this http://www.cs.vu.nl/~eliens/media/mobil ... urveTo.htm

    This is a canvas based drawing. I see we also have canvas plugin. But can we achieve this kind of smooth drawing even if we move cursor fast?

    Try to draw fast and you will still see the smoothness in the drawing.

    Thank you,

  • vijayrajesh

    well, I am sure that level of smoothness could be matched with some effort... The name of it (CurveTo) implies that it is calculating curves between mouse positions. My example below just draws from position to position, so it is not as smooth.

    This paint program was started by my son - he wanted to make a game where you draw your own weapon. I cut out the weapon parts (he had templates to trace and standard parts you could drop in, and then let you try it out).

    I made it draw in a random color, and added a small random amount to the line thickness to help smooth out the line a little.

    Use the scroll wheel to increase or decrease the pen thickness. The right mouse button erases, the left draws.

    (This requires ROJOhounds Canvas plugin).

    http://www.rieperts.com/games/forum/CanvasPainter.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • AllanR Thanks for your generosity in sharing such a wonderful source.

    Yes, It is smoother. And I have to honestly say, I can see sharp deviations when we draw faster. May be to make a good drawing program for kids, it is very useful indeed.

    BTW, does it work on touch devices too? Or should i change the code?

  • vijayrajesh that example does not use Touch, mouse only. Touch gets a little tricky because there is no Left and Right button or middle Scroll Wheel. I was working on a multi touch interface last month, and would want to track each touch point to make a proper touch paint program...

    but for now I quickly adapted the capx above for touch. You can't change the size of the brush. The second touch point becomes an eraser... It wouldn't be hard to make a proper tool palette to change brush size, color, etc.

    http://www.rieperts.com/games/forum/CanvasPainterTouch.capx

    The Canvas plugin does have various ways to draw curves - so getting smoother lines would be possible.

  • Once again thanks AllanR

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