# JSDoc: Class: ShapeStim

# 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:
  - visual/ShapeStim.js, line 44

### Extends

- VisualStim

### Members

#### (static, readonly) KnownShapes

Known shapes.

Source:
  - visual/ShapeStim.js, line 342

#### (protected) _getVertices_px

Get the vertices in pixel units.

Source:
  - visual/ShapeStim.js, line 303

#### 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:
  - visual/ShapeStim.js, line 148

#### setVertices

Setter for the vertices attribute.

Source:
  - visual/ShapeStim.js, line 106

### Methods

#### (protected) _estimateBoundingBox()

Estimate the bounding box.

Source:
  - visual/ShapeStim.js, line 181