Class: ShapeStim

visual.ShapeStim(options)

This class provides the basic functionality of shape stimuli.

Constructor

new ShapeStim(options)

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
name String the name used when logging messages from this stimulus
win module:core.Window the associated Window
lineWidth number the line width
lineColor Color <optional>
'white' the line color
fillColor Color the fill color
opacity number <optional>
1.0 the opacity
vertices Array.<Array.<number>> <optional>
[[-0.5, 0], [0, 0.5], [0.5, 0]] the shape vertices
closeShape boolean <optional>
true whether or not the shape is closed
pos Array.<number> <optional>
[0, 0] the position of the center of the shape
size number <optional>
1.0 the size
ori number <optional>
0.0 the orientation (in degrees)
units string the units of the stimulus vertices, size and position
contrast number <optional>
1.0 the contrast
depth number <optional>
0 the depth
interpolate boolean <optional>
true whether or not the shape is interpolated
autoDraw boolean <optional>
false whether or not the stimulus should be automatically drawn on every frame flip
autoLog boolean <optional>
false whether or not to log
Mixes In:
  • ColorMixin
Source:

Extends

  • VisualStim

Members

(static, readonly) KnownShapes

Known shapes.
Source:

(private) _getPolygon

Get the PIXI polygon (in pixel units) corresponding to the vertices.
Source:

(protected) _getVertices_px

Get the vertices in pixel units.
Source:

(private) _updateIfNeeded

Update the stimulus, if necessary.
Source:

contains

Determine whether an object is inside the bounding box of the ShapeStim. This is overridden in order to provide a finer inclusion test.
Source:

setVertices

Setter for the vertices attribute.
Source:

Methods

(protected) _estimateBoundingBox()

Estimate the bounding box.
Source: