ABSTRACT

The Screen(‘DrawText’) function allows us to put text on the screen. It takes a number of important inputs: first, the window (w1) that you opened at the start of the experiment to specify where the text will be drawn; second, the text that you want displayed; third, x and y coordinates for the starting location of the text on-screen; and, finally, the colour of the text. In this example, the coordinates are given relative to the ‘center’ coordinates

that were specified at the start of the experiment. By subtracting 100 pixels from center(1) (x-coordinate), and subtracting 10 pixels from center(2) (y-coordinate), we shift the starting point of the text 100 pixels to the left of centre, and then up from centre slightly, to compensate for the long string of text. Adding rather than subtracting pixels from centre would push the text in the opposite directions. Getting the perfect position for your text might require some trial and error, in which you run the script and then adjust the numbers until you are happy. For text colour, we here use the scalar value 255, which produces the text in white. If you wish, you can specify colour in other formats such as RGB. Check the Psychtoolbox help documents online for more information (e.g. https://en.m.wikibooks.org/wiki/MATLAB_P rogramming/Psychtoolbox/Screen_Commands/DrawText).