Access to sketchpad properties from a Python script
Hi,
Working on the problem of changing some features of a MCQ form (see my previous post), I realized that I would probably not be able to change a text-based design according to my needs. So I am trying to design a MCQ template in a sketchpad, using named objects and mouse-response.
In order to facilitate the selection of an object, I would like to highlight it when the mouse cursor goes over it, for instance by changing its color. So I need an additional Python script to do that. Is it possible to reference the sketchpad and/or some of its objects from the script or is it necessary to create an entire sketchap and do all the job with Python code ?
I have not seen any mention of this possibiity in the documentation, so I am not very optimistic about the result. But some workarounds may be possibe ?
Thank you in advance,
Gérard
Comments
Hi Gérard,
Yes, you can access sketchpad items in an inline_script. See here: https://osdoc.cogsci.nl/3.2/manual/stimuli/visual/#accessing-a-sketchpad-in-python
Anyway, drawing all the stimuli in Python code is not that much more difficult. So, it shouldn't be too much of a hassle.
Does that help?
Eduard
Hi Eduard,
Thank you for your reply and sorry for the delay. I've been away since September.
Sure it helps !
Cheers,
Gérard.