waitForAnimation

API - pauses script until an image is finished animating

return function()

    local app = getApp();
    
    local ob = app.createGameObject(); --create object to attach images to
    
    --add the image titled 'welcomeImage' to the object
    applyImage(ob, 'welcomeImage'); 
    
    ob.image.anchor('bottom left', true); --anchors the image to the bottom left... accounting for image dimensions = true
    
    waitForAnimation(ob.image); --pauses script until finished...
   
    applyImage(ob, 'byeImage');
    
    waitForAnimation(ob.image); --pauses script again until byeImage finished animating
    log('finished playing two animations!');
end

Last updated