Class: BaseShapeStim

visual.BaseShapeStim(options)

This class provides the basic functionalities of shape stimuli.

Constructor

new BaseShapeStim(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

  • BaseVisualStim

Methods

(private) _getPolygon() → {Object}

Get the PIXI polygon (in pixel units) corresponding to the vertices.
Source:
Returns:
the PIXI polygon corresponding to this stimulus vertices.
Type
Object

(private) _updateIfNeeded()

Update the stimulus, if necessary.
Source:

contains(object, units) → {boolean}

Determine whether this stimulus contains the given object.
Parameters:
Name Type Description
object Object the object
units string the units
Source:
Returns:
whether or not the stimulus contains the object
Type
boolean

setFillColor(fillColor, logopt)

Setter for the fill color attribute.
Parameters:
Name Type Attributes Default Description
fillColor Color the fill color
log boolean <optional>
false whether of not to log
Source:

setLineColor(lineColor, logopt)

Setter for the line color attribute.
Parameters:
Name Type Attributes Default Description
lineColor Color the line color
log boolean <optional>
false whether of not to log
Source:

setLineWidth(lineWidth, logopt)

Setter for the line width attribute.
Parameters:
Name Type Attributes Default Description
lineWidth number the line width
log boolean <optional>
false whether of not to log
Source:

setVertices(vertices, logopt)

Setter for the vertices attribute.
Parameters:
Name Type Attributes Default Description
vertices Array.<Array.<number>> the vertices
log boolean <optional>
false whether of not to log
Source: