Howdy, Stranger!

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

Supported by

[open] How to draw a set of dots for an Android experiment?

MayMay
edited October 2015 in OpenSesame

Hi,
I'm looking for a way to draw a set of dots in the sketchpad for an experiment to run on Android. I need to do it in a way that I can manipulate the number of dots as a variable. I've been reading this can generally be done by importing the ElementArrayStim function from PsychoPy, but is it possible to do this using the Droid back-end?
Also, would it be possible to control more advanced features such as the total area or circumference length of all dots?
Any advice will be greatly appreciated. Thanks!

Comments

  • edited 10:30AM

    I've been reading this can generally be done by importing the ElementArrayStim function from PsychoPy, but is it possible to do this using the Droid back-end?

    No, PsychoPy doesn't work on Android. However, you could use the xy_random() function (OpenSesame 3.0) to achieve more-or-less the same thing. Let's assume that you have an experimental variable called ndots, then the following script will draw this number of non-overlapping circle:

    c = canvas()
    for x, y in xy_random(n=var.ndots, width=100, height=100, min_dist=20):
        c.circle(x, y, r=10)
    c.show()
    

    See also:

    Cheers!
    Sebastiaan

Sign In or Register to comment.