Painting?

  • Hi there ,

    I'm exploring the possibilities of creating a paint app in construct 2. Problem is, I can't get it to draw smoothly. I'm currently creating a small sprite on each tick at Mouse.X and Mouse.Y, but they can't seem to keep up when I'm painting quickly.

    Any other ideas on how to tackle this?

    Thanks! <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Instead of creating sprites, paste them into the canvas plugin.

    Edit: Do you mean there are gaps? You can fix that by having 'previousx' and 'previousy' variables that store the previous tick's mouse x and y positions, then using a for loop: for distance(previousx, previousy, mouse.x, mouse.y) then position the pasting object with lerp to make a line between the two positions.

  • Thanks for the answer, but you kinda lost me at the for-loop :)

    I've set up the following loop:

    for "loopname" 0 to "distance(prevX, prevY, Mouse.X, Mouse.Y)". Is this correct? I have no idea on how to proceed with the pasting + lerp. First time using canvas plugin!

  • andreas: if you check the link with the painting app in my postmortem, you can see that when I draw, I use lines.

    I have done it like that :

    <img src="http://dl.dropbox.com/u/1412774/paintingexample.png" border="0" />

    (the blanks in the screenshot are there because of my client rights on the whole game.)

  • Pode

    You should do it more like that :D

    <img src="http://media.treehugger.com/assets/images/2011/10/censored20EPA20document.jpg" border="0" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Pode! I came up with something similar, but yours worked better :) Now I just have to find some way to smooth it out, like vector graphics.

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