what is distance in tween ?

  • someone guide me to use

    Quote

    tween(plugin[description].alpha,1.0,distance(1.0,0.8),easeOutQuart);

    wanted to know what does that distance(1.0,0.8) would do or make some effect ?
    explanation appreciated. tried to find on xml docs but couldnt

    Regards
    Mak

  • Can't give you a good clear explanation but I found it in the docs.

    Found it under tween and time.

    Quote

    Instead of using a fixed time for the change it is possible to define the maximum moving distance for the value and a time for that distance.
    This allows to use a short time for a short distance and long time for a long distance. This can be done by using the distance function:

    distance(maxdistance,maxtime)
    maxdistance - the maximum distance between the start and the destination value
    maxtime - the time in seconds for this maximum distance

  • Hi,

    here the link to the documentation:
    https://krpano.com/docu/actions/#tween

    it's a bit difficult to explain, but here a try:

    without distance() the tween will use the given time for changing the variable from the current value to the given one,

    but with distance() it's possible to define the distance between a min and max value and the need that would be needed for that distance,

    when the current value is now between the distance of the min/max values it would need a shorter time for changing,

    I have made a quick example here:
    https://krpano.com/krpano.html?xm…eendistance.xml

    click the both points and after 1-2 seconds click them again,
    on each click they will change the direction,

    the upper point will need 4 seconds for the whole way from left to right, but when clicked on
    the way during moving it will need fewer time (relative to the new distance) for the rest way,

    the lower point will need 4 seconds for every move, anytime, even if it is just a few pixels away
    from the the destination,

    best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!