Quartz Composer and Origami: Can't get X value to change with Interaction2 patch

388 views Asked by At

I'm learning Quartz Composer and Origami. I have a simple interaction set up like this:

quartz composer and origami interaction

I have an interaction2 patch attached to the image layer and a transition patch. On clicking the image layer, it should trigger a transition from 0 to 100. The output of the transition patch is wired to the x-position of the layer. So, presumably, when clicking the image layer, its x-position should go from 0 to 100.

However, the image layer just flickers quickly to an x-position of 100 but does permanently move.

Can anybody explain why this is happening and how to fix it?

Thanks!

2

There are 2 answers

0
s4l4x On

In your example the X Position of the layer is going from 0 to 100, but not when you're expecting it to. It seems like you are expecting the the value to go from 0 to 100 and then stay there, but instead it is going from 0 to 100 on mouse up and then back to 0. This is because the click is producing a signal, a value of 1 for a single frame.

Quartz Composer Switch

Try connecting the [Interaction 2] Down -> Progress [Transition] (meaning the Progress input port of the Transition node) and you'll see the layer move 100 in X when the mouse is down and then snap back to 0 when the mouse is up. To get the behavior you expect you need to flip a switch with the signal coming from the mouse and then set the range of that value.

1
Sijie Wang On

You will have to drag in a switch patch from the patch library, and hook it up between your interaction patch and transition patch.