rectangle

 element objects

One or more rectangles or squares. Options for border and solid or transparent fill also allow rectangular frames.

See also element type backColor.

(Transparency artifacts)

By default rectangle elements have a transparent background. In the unusual case that you draw multiple rectangles in the same rectangle element and they overlap and the top ones have transparency (properties color, borderColor below), you need to set property backColor = <cds>"opaque"<cds> for accurate display.

▸ Object ends on its own?

"Ends on its own" means ends automatically at that point. If an element can end on its own, you don't need to set end conditions for it in property end (unless you want it to maybe end earlier).

No—runs until any condition you set in property end.

Input properties
Record properties
rectangle
elements (see below)

size
color
borderWidth
borderColor
positions

All visual elements
position
depth

nn_eyes
rotation
flipHorz
flipVert

colorMask
alpha
intensity
contrastMult
convolution
shader
filterOrder
filterGrayscale
filterResolutionMult
filterGamma

channelResolution
backColor
addDisplay

All visual elements
position

All adjuster elements have
adjust

All elements
start
end

startBuffer
endBuffer

vary
staircase

All objects
info
report

size

Default: a square with sides 5 deg

A number that is side length for a square, or a vector [width height] for a rectangle (deg). Or if you use positions below to show multiple rectangles, you can use multiple rows for different sizes.

color

Default: white

A 1×3 RGB vector with numbers between 0–1 setting fill color. You can also use a 1×4 RGBA vector to give the fill transparency, and set A = 0 for no fill. Or if you use positions below to show multiple rectangles, you can use an n×3/4 matrix for different colors/transparencies.

borderWidth
borderColor

Default: borderWidth = no border
Default: borderColor = white

borderWidth is a number (deg). 0 = no border. Or if you use positions below to show multiple rectangles, you can use a vector for different border widths.

borderColor is a 1×3 RGB vector with numbers between 0–1 setting border color. You can also use a 1×4 RGBA vector to give the border transparency. Or an n×3/4 matrix for different border colors/transparencies.

positions

Default: show one rectangle centered at element position

If you want to show multiple rectangles at the same time, you can set that here. This is more efficient than using multiple rectangle elements. positions is a 2-column matrix setting centers for the rectangles, with rows corresponding to rectangles and columns to [x y] coordinates (deg). + = right⁠/⁠down and positions are relative to element position, which you can set in position (default relative to screen center). Rectangles are also layered front to back in the order you list them.

If you show multiple rectangles then for each of the properties above you can set one value for all of them, or different values for different rectangles using a vector or matrix (see property).

Adjustable properties

You can vary or allow the subject to adjust the following properties of an object of this type when it's running. If you need to make other properties adjustable, you can edit the element type code—see Element Type Programming Manual.

Adjustable properties

Adjustable properties

position
nn_eyes
rotation
colorMask
alpha
intensity
contrastMult
drawCodeVars

(None)

(None)

Input properties
Record properties

PsychBench uses record properties to record information during experiments. You can't set record properties but you can see them in experiment results using input property report.

rectangle
elements (see below)

All elements
startTime
endTime
duration
n_startFrame
n_endFrame
startLatencyBufferable
endLatencyBufferable