How to: control time of position movement?

Q&A about the latest versions
Post Reply
Jmondo
Posts: 73
Joined: Thu Nov 16, 2017 11:10 am

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!
User avatar
Hopki
Gnome
Posts: 13004
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

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
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
Jmondo
Posts: 73
Joined: Thu Nov 16, 2017 11:10 am

Thank you!
Post Reply