Paint Program

For questions about using Classic.

Post » Thu Jan 01, 2009 7:55 am

thanks
but can there be a method of adding line, square, circle, pen, eraser, bezier curve etc to be added under GRAPHIC category of INSERT OBJECT. because if we have to lern the programmin a lot then its quite difficult and canvas object only appears when we open bank game application. i think the purpose of construct is to help in making application easier. thanks ashlay
B
2
S
1
G
4
Posts: 48
Reputation: 1,296

Post » Thu Jan 01, 2009 6:09 pm

No, those features are not objects, they're canvas capabilities, so they would have to go in the canvas object.

What's the formula for cubic interpolation?
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Thu Jan 01, 2009 6:18 pm

Oops, I had an error in my previous post. Of course, when the number of order rises, the amount of parameters rises too. If I'm not mistaken, it's

[code:1w0nt6ri]lerp(lerp(lerp(a,b,x),lerp(b,c,x),x),lerp(lerp(b,c,x),lerp(c,d,x),x),x)[/code:1w0nt6ri]

And it can be shortened to [code:1w0nt6ri]lerp(qarp(a,b,c,x), quarp(b,c,d,x), x)[/code:1w0nt6ri]

Fortunately cubic curve is the curve of highest order needed in practical computing :D...
B
3
S
2
G
5
Posts: 263
Reputation: 2,201

Post » Thu Jan 01, 2009 9:42 pm

[quote="Ashley":1h03x3zc]No, those features are not objects, they're canvas capabilities, so they would have to go in the canvas object.

What's the formula for cubic interpolation?[/quote:1h03x3zc]

well i have it in my game, one sec

this is what i use for x
(((Sprite15.x+((Sprite14.x-Sprite15.x)* ('t')))+(((Sprite14.x+((Sprite.ImagePointX(5)-Sprite14.x)* ('t')))-(Sprite15.x+((Sprite14.x-Sprite15.x)* ('t'))))* ('t')))+((((Sprite14.x+((Sprite.ImagePointX(5)-Sprite14.x)* ('t')))+(((Sprite.ImagePointX(5)+((Sprite.ImagePointX(4)-Sprite.ImagePointX(5))* ('t')))-(Sprite14.x+((Sprite.ImagePointX(5)-Sprite14.x)* ('t'))))* ('t')))-((Sprite15.x+((Sprite14.x-Sprite15.x)* ('t')))+(((Sprite14.x+((Sprite.ImagePointX(5)-Sprite14.x)* ('t')))-(Sprite15.x+((Sprite14.x-Sprite15.x)* ('t'))))* ('t'))))* ('t')))

for y
(((Sprite15.y+((Sprite14.y-Sprite15.y)* ('t')))+(((Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t')))-(Sprite15.y+((Sprite14.y-Sprite15.y)* ('t'))))* ('t')))+((((Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t')))+(((Sprite.ImagePointY(5)+((Sprite.ImagePointY(4)-Sprite.ImagePointY(5))* ('t')))-(Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t'))))* ('t')))-((Sprite15.y+((Sprite14.y-Sprite15.y)* ('t')))+(((Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t')))-(Sprite15.y+((Sprite14.y-Sprite15.y)* ('t'))))* ('t'))))* ('t')))

as you can see, its a B**** to set up, and its very confusing, having a Carp(a,b,c,d,x) would be very usefull, as drasa said, thankfully cubic is the highest order needed.

for a 5 order thing youd need something like

((((Sprite15.y+((Sprite14.y-Sprite15.y)* ('t')))+(((Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t')))-(Sprite15.y+((Sprite14.y-Sprite15.y)* ('t'))))* ('t')))+((((Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t')))+(((Sprite.ImagePointY(5)+((Sprite.ImagePointY(4)-Sprite.ImagePointY(5))* ('t')))-(Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t'))))* ('t')))-((Sprite15.y+((Sprite14.y-Sprite15.y)* ('t')))+(((Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t')))-(Sprite15.y+((Sprite14.y-Sprite15.y)* ('t'))))* ('t'))))* ('t'))))+(((((Sprite15.y+((Sprite14.y-Sprite15.y)* ('t')))+(((Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t')))-(Sprite15.y+((Sprite14.y-Sprite15.y)* ('t'))))* ('t')))+((((Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t')))+(((Sprite.ImagePointY(5)+((Sprite.ImagePointY(4)-Sprite.ImagePointY(5))* ('t')))-(Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t'))))* ('t')))-((Sprite15.y+((Sprite14.y-Sprite15.y)* ('t')))+(((Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t')))-(Sprite15.y+((Sprite14.y-Sprite15.y)* ('t'))))* ('t'))))* ('t'))))-((((((Sprite15.y+((Sprite14.y-Sprite15.y)* ('t')))+(((Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t')))-(Sprite15.y+((Sprite14.y-Sprite15.y)* ('t'))))* ('t')))+((((Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t')))+(((Sprite.ImagePointY(5)+((Sprite.ImagePointY(4)-Sprite.ImagePointY(5))* ('t')))-(Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t'))))* ('t')))-((Sprite15.y+((Sprite14.y-Sprite15.y)* ('t')))+(((Sprite14.y+((Sprite.ImagePointY(5)-Sprite14.y)* ('t')))-(Sprite15.y+((Sprite14.y-Sprite15.y)* ('t'))))* ('t'))))* ('t'))))+)*('t'))

yea, something like that.

the wikipedia article explains it very well
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Thu Jan 01, 2009 9:59 pm

OK, got a cubic expression in the next build!
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Fri Jan 02, 2009 6:39 am

thanks
hoping to see a paint program template in next release to start with.
B
2
S
1
G
4
Posts: 48
Reputation: 1,296

Post » Fri Jan 02, 2009 6:43 am

[quote="hkg.mahwa":vnf3ubiq]thanks
hoping to see a paint program template in next release to start with.[/quote:vnf3ubiq]

I'm not a dev but I think I can safely say this will never happen.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Jan 02, 2009 6:52 am

please
i am very eager to see it because if you see that Old Paint Example, it even didn't draw a line. but it is useful for open, save and file filter dialogs learning.
B
2
S
1
G
4
Posts: 48
Reputation: 1,296

Post » Fri Jan 02, 2009 11:41 am

You should try and do stuff yourself then, start off easy then work up to what you want. We don't aim to provide a template for everything that can be made. If you work with the example and try adding other things to it you should be able to make something work for you.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Tue Jan 06, 2009 7:03 am

B
2
S
1
G
4
Posts: 48
Reputation: 1,296

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests