Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] location location location

edited January 2013 in OpenSesame

Hi,

Im really new to programming in general and to open sesame in particular
so this question might be stupid.
Here goes - I show a visual stimuli on my screen and want then to show another when
just on the opposite side of the screen (referring only to the 'x' axis). I don't want to create
another variable for that, rather I would like to enter in the code area something like
'draw image -[target_position] 0 etc .... this form is unacceptable. anyone knows how should it be written ?

thank you

Comments

  • edited 8:16PM

    Hi,

    OpenSesame script is a simple definitional syntax, and does indeed not support calculations etc. But it's easily implemented with a simple Python inline_script. Let's say that you have defined a variable myX somewhere, such as in a loop item. And you want to present a fixation dot at this X coordinate and also at the 'opposite' X coordinate. Then you make a sketchpad like this ...

    draw fixdot [myX] 0 color=white show_if="always" draw fixdot [myOppositeX] 0 color=white show_if="always"

    ... and at the start of the trial sequence you add an inline_script item with the following code in the prepare phase:

    exp.set('myOppositeX', -self.get('myX'))

    Does that make sense? So you use a simple line of Python to accomplish what you want.

    Hope this helps!

    Sebastiaan

  • edited 8:16PM

    thank you very much ! :))

Sign In or Register to comment.