Combining tweens (in parallel)

  • Is it possible to have two tween actions occur simultaneously?

    I want to have the visual effect of a new hotspot 'dropping' into the KRPano image by combining scale and alpha. The following code would ideally add a hotspot and then animate it 'down' onto the KRPano:

    Code
    // initial setup
    addhotspot(h);
    set(hotspot[h].scale, 10);
    set(hotspot[h].alpha, 0.3);
    // now animate
    tween(hotspot[h].scale, 1, 0.5);
    tween(hotspot[h].alpha, 1, 0.5);

    ..but the last two lines, of course, are executed in serial. i.e. the hotspot first reduces in size and *then* becomes opaque.

    Can this be done?

  • Hi,

    Zitat

    ..but the last two lines, of course, are executed in serial.

    The tween actions in your code will NOT be executed in serial.

    The tween() call only starts the execution but then it will run parallel.

    For serial sequences the 'donecall' of the tween would need to be used.


    Multiple-variable tweens could be used too, but the result will be the same as the two tween calls - e.g.

    Code
    tween(hotspot[h].scale|hotspot[h].alpha, 1.0|1.0, 0.5);


    or

    Code
    callwith(hotspot[h], tween(scale|alpha, 1.0|1.0, 0.5) );

    Best regards,
    Klaus

  • Doh! Sorry, I have no idea how I completely missed that sub-section of the tween documentation.

    I have it working now - thanks for replying and apologies for wasting your time by not RTFMing.

    Cheers
    Martin

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!