Class: TextStim

visual.TextStim(options)

new TextStim(options)

Parameters:
Name Type Attributes Default 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
text string <optional>
"Hello World" the text to be rendered
font string <optional>
"Arial" the font family
pos Array.<number> <optional>
[0, 0] the position of the center of the text
color Color <optional>
Color('white') the background color
opacity number <optional>
1.0 the opacity
depth number <optional>
0 the depth (i.e. the z order)
contrast number <optional>
1.0 the contrast
units string <optional>
"norm" the units of the text size and position
ori number the orientation (in degrees)
height number <optional>
0.1 the height of the text
bold boolean <optional>
false whether or not the text is bold
italic boolean <optional>
false whether or not the text is italic
alignHoriz string <optional>
'left' horizontal alignment
alignVert string <optional>
'center' vertical alignment
wrapWidth boolean whether or not to wrap the text horizontally
flipHoriz boolean <optional>
false whether or not to flip the text horizontally
foptions.lipVert boolean <optional>
false whether or not to flip the text vertically
options.clipMask PIXI.Graphics the clip mask
options.autoDraw boolean <optional>
false whether or not the stimulus should be automatically drawn on every frame flip
options.autoLog boolean <optional>
false whether or not to log
Mixes In:
  • ColorMixin
Source:
To Do:
  • vertical alignment, and orientation are currently NOT implemented

Extends

  • VisualStim

Members

(private, readonly) _defaultLetterHeightMap

This map associates units to default letter height.

Source:

(private, readonly) _defaultLetterHeightMap

This map associates units to default wrap width.

Source:

(protected) _getDefaultLetterHeight

Get the default letter height given the stimulus' units.
Source:

(protected) _getDefaultWrapWidth

Get the default wrap width given the stimulus' units.
Source:

(private) _getTextStyle

Get the PIXI Text Style applied to the PIXI.Text
Source:

getTextMetrics

Get the metrics estimated for the text and style. Note: getTextMetrics does not require the PIXI representation of the stimulus to be instantiated, unlike getSize().
Source:

Methods

(protected) _estimateBoundingBox()

Estimate the bounding box.
Source:

(private) _getAnchor() → {Array.<number>}

Convert the alignment attributes into an anchor.
Source:
Returns:
- the anchor
Type
Array.<number>

(private) _updateIfNeeded()

Update the stimulus, if necessary.
Source: