Painting?

Get help using Construct 2

Post » Wed Feb 01, 2012 8:06 pm

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!
B
7
S
2
G
4
Posts: 8
Reputation: 2,673

Post » Wed Feb 01, 2012 8:23 pm

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.Arima2012-02-01 20:29:25
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Wed Feb 01, 2012 9:27 pm

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!
B
7
S
2
G
4
Posts: 8
Reputation: 2,673

Post » Thu Feb 02, 2012 9:58 am

@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 :

(the blanks in the screenshot are there because of my client rights on the whole game.)
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Thu Feb 02, 2012 12:12 pm

@Pode
You should do it more like that :D
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Feb 02, 2012 3:13 pm

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.
B
7
S
2
G
4
Posts: 8
Reputation: 2,673


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 20 guests