applyImage

API - applies an image or animation to a GameObject.

return function()
    wait(2);
    local app = getApp();
    local ob = app.createGameObject(); --create object to attach images to
    applyImage(ob, 'welcomeImage'); --add the image titled 'welcome' to the object
    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...
    wait(2);
    applyImage(ob, 'byeImage');
    waitForAnimation(ob.image);
    log('finished playing two animations!');
end

You must first create an image for it to be used in applyImage()

To create an image for the script to use, go back into Bot Commands > under advanced select the Images option button, then click "Create New".

After creating the image, select a .png sprite-sheet to be uploaded. If your image is animated, set the width and height values to be a single frame of the sprite-sheet. (this also works with gifs but it is less optimized.)

Last updated