Class: ShapeStim

visual.ShapeStim(options)

This class provides the basic functionalities 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 Window the associated Window
lineWidth number the line width
lineColor Color <optional>
Color('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 this stimulus contains the given object.
Source:

refresh

Force a refresh of the stimulus.
Source:

setFillColor

Setter for the fill color attribute.
Source:

setLineColor

Setter for the line color attribute.
Source:

setLineWidth

Setter for the line width attribute.
Source:

setSize

Setter for the size attribute.
Source:

setVertices

Setter for the vertices attribute.
Source: