create a canvas expression relative to on move y

Discuss Lemur and share techniques.
Post Reply
Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34
create a canvas expression relative to on move y

Post by Softcore » 17 Mar 2014 14:35

I 've been struggling with this over 3 days and my brain is fried.....lol

So, lets say we want to have an expression x inside a Canvas object and we wish this expression x to "change" relatively to a cursor's y but only relatively...as in, when cursor y goes up, x goes up from its last value, when cursor y goes down, x goes down.

I tried to do the following:

create custom expression "touchy"

add a script on cursor move

touchy = y;

Thus,

on expression, touchy , -
x -= 0.1;

on expression, touchy, +
x += 0.1;

Unfortunately, the above is not working as I hoped it would because when we have a fast movement of the cursor on Y axis, not all its value canges trigger the above scripts, so instead of having the x change faster when we move the cursor faster, the oposite happens.

Obviously, there must be a more efficient and elegant way to pull this off...but as I said...I start seing smoke coming out of my brain lol

Any ideas?

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: create a canvas expression relative to on move y

Post by Softcore » 17 Mar 2014 17:56

Nevermind, a friend and member of the forums, gave me a very nice solution.

Thanks Saveas! ;)

nick_liine
Liine Staff
Posts:340
Joined:01 Oct 2010 11:06

Re: create a canvas expression relative to on move y

Post by nick_liine » 20 Mar 2014 11:56

Also have a look at the relative fader example in the Canvas Learning Pack, this implements relative cursor movements.

Post Reply