Page 1 of 1

How to: control time of position movement?

Posted: Thu Nov 16, 2017 10:34 pm
by Jmondo
Hi,

How do I effect the transition time of the position movement of an object? I know how to make an object move with the position action, but I don't know how to enable a transition time for it. I believe this can be done with a timer, but the proper execution of the actions/logic blocks to make this happen is unclear to me.

Additionally, is there a way to "ease out" of the movement?

Any assistance would be greatly appreciated.

Thanks!

Re: How to: control time of position movement?

Posted: Fri Nov 17, 2017 12:15 pm
by Hopki
Hi,
If you use a variable and logic lock you can set the time in seconds for the transition.
This will use ease in and out as it toggles.

To set this up add a variable to the skin, example "MovePoss" and use a true/false type, set to false as Init Value.

Add two rectangles, Rectangle 1 and Rectangle 2.
Rectangle 1 will be the button to change the variable.
Rectangle 2 will be the element that we will move.

Select Rectangle 1 and add the action:
Source: Mouse Click
Action: Set Variable Value
Variable Name: MovePoss
Operation: Not(¬)

Note:
The operation Not(¬) is a toggle action, toggling between false and true.

Select Rectangle 2 and select the Position Logic Block.
Set Trigger *MovePoss
Comparison: =
Value: true
X: xxxx
Y: xxxx

xxx being the new position.

If you preview this now you will see that Rectangle 2 jumps between the two positions.

Go back to Rectangle 2 and the position Logic Block, then under Transition select Enable.
Set the transition time and click OK then preview the skin.

Clicking Rectangle 1 will now slide Rectangle 2 between to two position with the ease function.

This works with most of the Logic Blocks, Colour, Scale etc, etc.
Note:
If you use a Transition in one Logic Block then you need to use this in all Logic Blocks for the same element.

Regards,
Hopki

Re: How to: control time of position movement?

Posted: Fri Nov 17, 2017 2:22 pm
by Jmondo
Thank you!