Text Component¶
This component can be used to present text to the participant, either instructions or stimuli. It differs from Textbox Component in that changing the size of the stimulus changes the size of the text itself, not the box containing the text.
- Categories:
Stimuli
- Works in:
PsychoPy, PsychoJS
Parameters¶
Basic¶
The required attributes of the stimulus, controlling its basic function and behaviour
- Name
Everything in a PsychoPy® experiment needs a unique name. The name should contain only letters, numbers and underscores (no punctuation marks or spaces).
- Start
When the Text Component should start, see Defining the onset/duration of components.
- Expected start (s)
If you are using frames to control timing of your stimuli, you can add an expected start time to display the component timeline in the routine.
- Start type
How do you want to define your start point?
Options:
time (s)
frame N
condition
- Stop
When the Text Component should stop, see Defining the onset/duration of components.
- Expected duration (s)
If you are using frames to control timing of your stimuli, you can add an expected duration to display the component timeline in the routine.
- Stop type
How do you want to define your end point?
Options:
duration (s)
duration (frames)
time (s)
frame N
condition
- Text
The text to be displayed
Layout¶
How should the stimulus be laid out on screen? Padding, margins, size, position, etc.
- Position [x,y]
Position of this stimulus (e.g. [1,2] )
- Spatial units
Spatial units for this stimulus (e.g. for its position and size), see Units for the window and stimuli for more info.
Options:
from exp settings
deg
cm
pix
norm
height
degFlatPos
degFlat
- Orientation
Orientation of this stimulus (in deg)
Options:
-360
360
- Draggable?
Should this stimulus be moveble by clicking and dragging?
- Wrap width
How wide should the text get when it wraps? (in the specified units)
- Flip (mirror)
Whether to mirror-reverse the text: ‘horiz’ for left-right mirroring, ‘vert’ for up-down mirroring. The flip can be set dynamically on a per-frame basis by using a variable, e.g., $mirror, as defined in a code component or conditions file and set to either ‘horiz’ or ‘vert’.
Options:
horiz
vert
None
Appearance¶
How should the stimulus look? Colors, borders, styles, etc.
- Text color
Color of the text (e.g. $[1,1,0], red )
- Color space
In what format (color space) have you specified the colors? See Color spaces for more info.
Options:
rgb
dkl
lms
hsv
- Opacity
Vary the transparency, from 0.0 (invisible) to 1.0 (opaque)
- Contrast
Contrast of the stimulus (1.0=unchanged contrast, 0.5=decrease contrast, 0.0=uniform/no contrast, -0.5=slightly inverted, -1.0=totally inverted)
Formatting¶
How should this stimulus handle text? Font, spacing, orientation, etc.
- Font
What font should the text be displayed in? Locally, can be a font installed on your computer, saved to the “fonts” folder in your PsychoPy® user folder, or the name of a Google Font. Online, can be any web safe font or a font file added to your resources list in Experiment settings.
- Letter height
The height of the characters in the given units of the stimulus/window. Note that nearly all actual letters will occupy a smaller space than this, depending on font, character, presence of accents etc. The width of the letters is determined by the aspect ratio of the font.
- Language style
Handle right-to-left (RTL) languages and Arabic reshaping
Options:
LTR
RTL
Arabic
Data¶
What information about this Component should be saved?
- Save onset/offset times
Store the onset/offset times in the data file (as well as in the log file).
- Sync timing with screen refresh
Synchronize times with screen refresh (good for visual stimuli and responses based on them)
Testing¶
Tools for testing, debugging and checking the performance of this Component.
- Disable Component
Disable this Component
- Validate with…
Name of the Validator Routine to use to check the timing of this stimulus. Options are generated live, so will vary according to your setup.
See also
API reference for TextStim