It looks the option for custom polygon components doesn’t work fully in PsychoJS yet. bsclod’s solution in that thread might work for you.
- create your Polygon component as normal
- add a code component with the following in
begin routine
(code written in python, the auto-translate option will convert it to JS):
NAME_OF_COMPONENT.vertices = [LIST OF VERTICES]
For example, if you named your Polygon component arrow
, and want to use the vertices above, your code might be:
arrow.vertices = [(-0.4,0.05),(-0.4,-0.05),(-.2,-0.05),(-.2,-0.1),(0,0),(-.2,0.1),(-.2,0.05)]
I tested this in PsychoPy 2022.2.4 builder and it works in both PsychoPy and PsychoJS.