VisualStim

visual. VisualStim

Base class for all visual stimuli.

Constructor

new VisualStim(options)

Source:
Mixes In:
  • WindowMixin
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

units string <optional>
"height"

the units of the stimulus (e.g. for size, position, vertices)

ori number <optional>
0.0

the orientation (in degrees)

opacity number <optional>
1.0

the opacity

depth number <optional>
0

the depth (i.e. the z order)

pos Array.<number> <optional>
[0, 0]

the position of the center of the stimulus

size number <optional>
1.0

the size

clipMask PIXI.Graphics <optional>
null

the clip mask

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

Extends

Methods

(protected) _estimateBoundingBox()

Source:

Estimate the bounding box.

(protected) _getBoundingBox_px() → {PIXI.Rectangle}

Source:

Get the bounding box in pixel coordinates

Returns:

the bounding box, in pixel coordinates

Type
PIXI.Rectangle

(protected) _onChange(withPixiopt, withBoundingBoxopt) → {function}

Source:

Generate a callback that prepares updates to the stimulus. This is typically called in the constructor of a stimulus, when attributes are added with _addAttribute.

Parameters:
Name Type Attributes Default Description
withPixi boolean <optional>
false

whether or not the PIXI representation must also be updated

withBoundingBox boolean <optional>
false

whether or not to immediately estimate the bounding box

Returns:
Type
function

(abstract, protected) _updateIfNeeded()

Source:
Overrides:

Update the stimulus, if necessary.

Note: this is an abstract function, which should not be called.

contains(object, units) → {boolean}

Source:
Overrides:

Determine whether an object is inside the bounding box of the stimulus.

Parameters:
Name Type Description
object Object

the object

units string

the units

Returns:

whether or not the object is inside the bounding box of the stimulus

Type
boolean

draw()

Source:
Overrides:

Draw this stimulus on the next frame draw.

hide()

Source:
Overrides:

Hide this stimulus on the next frame draw.

refresh()

Source:

Force a refresh of the stimulus.

refresh() is called, in particular, when the Window is resized.

release(logopt)

Source:
Overrides:

Release the PIXI representation, if there is one.

Parameters:
Name Type Attributes Default Description
log boolean <optional>
false

whether to log

setAutoDraw(autoDraw, logopt)

Source:
Overrides:

Setter for the autoDraw attribute.

Parameters:
Name Type Attributes Default Description
autoDraw boolean

the new value

log boolean <optional>
false

whether to log

setDepth(depth, logopt)

Source:

Setter for the depth attribute.

Parameters:
Name Type Attributes Default Description
depth Array.<number> 0

order in which stimuli is rendered, kind of css's z-index with a negative sign.

log boolean <optional>
false

whether of not to log

setOri(ori, logopt)

Source:

Setter for the orientation attribute.

Parameters:
Name Type Attributes Default Description
ori number

the orientation in degree with 0 as the vertical position, positive values rotate clockwise.

log boolean <optional>
false

whether of not to log

setPos(pos, logopt)

Source:

Setter for the position attribute.

Parameters:
Name Type Attributes Default Description
pos Array.<number>

position of the center of the stimulus, in stimulus units

log boolean <optional>
false

whether of not to log

setSize(size, logopt)

Source:

Setter for the size attribute.

Parameters:
Name Type Attributes Default Description
size undefined | null | number | Array.<number>

the stimulus size

log boolean <optional>
false

whether of not to log