- A C library for programming cognitive experiments on Windows
Defined in textio.h and textio.c
The text input-output functions all take the smallest possible number of parameters to put something on the screen: two coordinates, and a format string.
The vertical coordinates are interpreted differently by the two coordinate systems. With Cartesian coordinates, the text is vertically centered around the y coordinate. With standard coordinates, the y coordinate corresponds to the top of the text (like in other libraries).
The format string is the same as the standard C printf and scanf function families. It does
not recognize the \t
and \n
escape characters, however. These are
rendered as a a caret (^
).
Drawing parameters are set with the graphics parameter functions.
Returns the length of the output string in pixels.
Returns the length of the output string in pixels.
Returns the length of the output string in pixels.
Returns the length of the output string in pixels.
By default, the standard US keyboard layout (qwerty) is used. If you want to use another keyboard layout, you will have to reconfigure Allegro on a per-computer basis. The Tscope FAQ explains you how.
Returns the number of variables that have been read successfully, or EOF (-1) if no input has been read at all. If reading fails, the content of the supplied variables is not altered. Therefore it is advisable to initialize any variables supplied to ts_scanf before calling the function, and/or to check the return value of ts_scanf after the call.