Experimentor can be used to create and display numerous shapes, images and text on the screen for the subject to interact with.

There are two different ways to creating shapes, images or text. The first is the fast and recommended approach, while the second is slightly more powerful but also more verbose.

Approach 1: Creating shapes quickly and easily

This approach is hopefully very straightforward; it creates a shape at a particular location on the screen and allows you to easily setup a few properties (such as colour or radius):

The first shape ( target1 ) is positioned at x = 50% (which is the horizontal middle of the screen), and y = 60% (just below the vertical middle of the screen) with a radius of 10% of the screen’s height, and a colour of #55AA2B. This shape will not be initially visible on the screen.

The second circle is almost the same, but with a colour of red, and it will be initially visible on the screen.

This approach is only intended for shapes that use most of the default property values.

Approach 2: Defining shape “templates”

The second approach is to define the type of a shape. This allows you to then create multiple copies of the shape, basically using the defined type as a template. Let’s look at an example:

The above code creates a type of a circle that we decided to call MyBasicCircle. Inside this “template” definition we set the colour, radius, x & y position on the screen, and the initial visibility. Notice that at this point we have only defined the abstract concept (or “template”) of our basic circle – there are no actual circles created in the computer’s memory or on the screen.

Then we have two lines that use this template to create two different circle instances. Now we have two circles created inside the computer’s memory, but because their initial isVisible property was set to false they have not yet appeared on the screen.

Finally, we change the colour of the second circle to red, and make it visible on the screen. This means that we have two circles in memory, and one of them is actually visible on the screen.