psychopy.org | Reference | Downloads | Github

Drawing using the mouse as a brush

URL of experiment: https://pavlovia.org/run/rockNroll/demo_drawing/html
Code in: https://gitlab.pavlovia.org/rockNroll/demo_drawing

Dear all!
I’m trying to run an online experiment in which the subject has to draw some figures with the mouse (see GIF below).
Nothing really complicated: I created the python code, I imported in the builder, and now I’m trying to create the online experiment.
Everything is working, except I have an annoying closing effect, in which the code tries to close the polygon I create (run the online experiment and you’ll see it).
I checked: any browser does that.

Any suggestion?

Thanks in advance!
Best,
Michele

drawing_demo

2 Likes

Very nice job of what you’ve done so far! :slight_smile: When this works I think we should definitely include it as a demo of what can be achieved with a bit of code (if that’s OK with you?)!

ShapeStim in PsychoPy has an argument closeShape which defaults to True
http://www.psychopy.org/api/visual/shapestim.html#psychopy.visual.ShapeStim

and it looks like that has been implemented identically in PsychoJS:

Amazing @jon! It’s working inserting closeShape: false .
Thanks a lot!
It’s strange that with python (builder or code) it’s working anyway, even if the default is closeShape=True.

Of course you can use it: I would be proud of it!! :slight_smile:
Let me share also the python code for the #coder mode: https://github.com/rockNroll87q/pyDrawing

Thanks. Actually, I’m thinking a step further now - your code coud be the beginning of a Pen Component in Builder!

3 Likes

Hey @jon, I have a working version in Python based on @rockNroll87q nice work. Happy to get working on the Builder implementation if you or @rockNroll87q are not planning on making a pull request.

1 Like