Welcome!

Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Let images move

Hi all,

I am working on an experiment and the idea is that the participants will see three pictures in a row (horizontal): In some trials the first picture has to move upwards and the second and third picture downwards. In other trials the first and second picture have to move upwards and only the third picture downwards (difference in speed will be great too). Or even more complicated, the first pictures jumps over the second and third picture and the second and third picture have to move a little to the left. I was wondering whether this is even possible by just using a script for example, and if so, how to do this?

If not, suggestions are more than welcome! I have thought about making short movies with powerpoint and upload these, but because we will have between 210 and 300 items I am afraid we will get memory issues.

Many thanks!
Felicity

Comments

  • sebastiaansebastiaan Posts: 2,950

    HI Felicity,

    The easiest way to solve this is by using OpenSesame 3.2, which is currently in prerelease but will be released as stable soon:

    This new version allows you to assign names to elements from a sketchpad. So say that you have a sketchpad called my_sketchpad with three pictures named 'pic1', 'pic2', and 'pic3'.

    You can then insert a simple inline_script immediately after my_sketchpad that gets the canvas of the sketchpad, and then changes the position of the elements in a for loop, so as to create an animation. Do you see the general idea? The script below will move 'pic1' and 'pic3' downward, and 'pic2' upward, but you can create all kinds of complicated animations this way.

    my_canvas = items['my_sketchpad'].canvas
    for frame in range(100):
        my_canvas['pic1'].y += 1
        my_canvas['pic2'].y -= 1
        my_canvas['pic3'].y += 1
        my_canvas.show()
    

    Cheers!
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

Sign In or Register to comment.