Getting a text message to move slightly (ideally in Sketchpad)
I'm a newby to OS. However, your tutorials have really helped me get going. Needless to say I'm trying to keep the coding as simple as possible. Is there an easy way to get a piece of text in Sketchpad move / animate slightly without embedding videos. I need it as it part of an experiment to see what is the best stimulus for peripheral alerts.
Thanks
Comments
Hi @Stroller,
Thanks for your interest in OpenSesame and in the tutorials, and welcome to the forum! :)
If you exclusively want to use the graphical user interface, I think you could do the following:
loop-sequencestructure to your trial_sequenceloopitem. The smaller you make the steps between the subsequent positions, the smoother the animation will be. (In the example I made steps of 10 pixels, which is not very smooth)I uploaded an example here:
However, because there are limits to the number of (x,y) combinations that you manually can/want to define in the block_loop, having a little bit of inline code to determine the x and y positions gives you much more freedom and flexibility.
If the latter is what you want, then please let us know whether you want to run your study locally (in which case we'll use Python inline scripting) or in the browser (which requires JavaScript code).
Hope this helps!
Cheers,
Lotje
Did you like my answer? Feel free to

Hi Lotje
Fantastic. I'll give it a try. I'm running the study locally.
Kind Regards
Stroller
Hi @Stroller , ok, great! Let us know if you want to go for the inline-script option.
Did you like my answer? Feel free to

Hi @lvanderlinden . It works pretty well. However, I would be interested in seeing the inline-script option (if you have time) to see if it improves the experiment and also as a learning point for me.
Thanks
Stroller
Hi @Stroller ,
With Python inline script, you could do the following:
inline_scriptitem to the beginning of your trial_sequenceand put something like the following in itsPreparetab (see comments for further explanation):inline_scriptitem to thesequenceitem that is embedded in the trial_sequence(which I called "move_sequence" in the example). In thePreparetab, define the current x and y positions like so:loop(here "move_loop") the appropriate length, you need to tweak the OpenSesame script (not to be confused with Python script) of this item a little bit. To do that: click on View script (where my cursor is in the screenshot below) and change the line setting the repeat value to the variable "n_steps" as defined in the first inline_script item, like so:I uploaded an example file.
Let me know if this helps!
Cheers,
Lotje
Did you like my answer? Feel free to

Hi Lotje, Thanks for all your help. I was really strugling. I have learnt a lot from your help. It's worked perfectly
Thank you so much for the coffee! :)
Did you like my answer? Feel free to
