Update Text Options: Update Code authored by Fabian Berg's avatar Fabian Berg
...@@ -14,27 +14,27 @@ Use this function to plot a text on the presentation window. A wrapper function ...@@ -14,27 +14,27 @@ Use this function to plot a text on the presentation window. A wrapper function
**Inputs-optional** **Inputs-optional**
~~~ ~~~
varargin ‘x’ x position in percent (0 --> left, 100 --> right) varargin 'x' x position in percent (0 --> left, 100 --> right)
‘y’ y position in percent (0 --> top, 100 --> bottom) 'y' y position in percent (0 --> top, 100 --> bottom)
orientation orientation of the text, always followed by one of these 'orientation' orientation of the text, always followed by one of these
arguments: arguments:
center default value 'center' default value
left text starts at given x value (needs x value as 'left' text starts at given x value (needs x value as
additional input argument) additional input argument)
right text ends at given x value (needs x value as 'right' text ends at given x value (needs x value as
additional input argument) additional input argument)
rect plots text centered in the given rect! good for long 'rect' plots text centered in the given rect! good for long
texts. rect is the standard Psychtoolbox rect format: texts. rect is the standard Psychtoolbox rect format:
[xUpper yUpper xLower yLower] for pixel number (advanced [xUpper yUpper xLower yLower] for pixel number (advanced
users) users)
color text color as RGB vector with values from 0:255 'color' text color as RGB vector with values from 0:255
size text size in pixel 'size' text size in pixel
time time to wait 'time' time to wait
key wait until any key is pressed 'key' wait until any key is pressed
dontFlip don't flip buffers (advanced users) 'dontFlip' don't flip buffers (advanced users)
wrapat wrap text if it's to long after given number of 'wrapat' wrap text if it's to long after given number of
characters characters
speed speeds up text drawing. Makes Text positioning more 'speed' speeds up text drawing. Makes Text positioning more
inaccurate and text is without anti-aliasing. inaccurate and text is without anti-aliasing.
~~~ ~~~
...@@ -94,12 +94,12 @@ Use this function to display instructions or information to a subject. The text ...@@ -94,12 +94,12 @@ Use this function to display instructions or information to a subject. The text
**Inputs-optional** **Inputs-optional**
~~~ ~~~
noKey presents the text and doesn't wait for the user input 'noKey' presents the text and doesn't wait for the user input
noClear presents the text, but the screen isn't cleared after the user pressed a key 'noClear' presents the text, but the screen isn't cleared after the user pressed a key
wrapat wraps the text after the given number of characters without wrapping within words 'wrapat' wraps the text after the given number of characters without wrapping within words
color text color as RGB vector with values from 0:255 'color' text color as RGB vector with values from 0:255
size changes text size in pixel (only for the current screen, not globally) 'size' changes text size in pixel (only for the current screen, not globally)
align aligns the text horizontally. The strings 'left', 'center' and 'right' are allowed as arguments 'align' aligns the text horizontally. The strings 'left', 'center' and 'right' are allowed as arguments
~~~ ~~~
**Examples** **Examples**
...@@ -120,11 +120,11 @@ Draws a white fixations cross on the screen and waits specified time ...@@ -120,11 +120,11 @@ Draws a white fixations cross on the screen and waits specified time
**Inputs** **Inputs**
~~~ ~~~
varargin time time to wait in seconds varargin 'time' time to wait in seconds
size size of cross in pixel (default 20) 'size' size of cross in pixel (default 20)
penWidth pen width for cross 'penWidth' pen width for cross
color color triplet (default white [255 255 255]) 'color' color triplet (default white [255 255 255])
dontFlip don't flip buffers (advanced users) 'dontFlip' don't flip buffers (advanced users)
~~~ ~~~
**Examples** **Examples**
...@@ -153,19 +153,19 @@ Use this function to plot a scale on the stimulus presentation window that is hi ...@@ -153,19 +153,19 @@ Use this function to plot a scale on the stimulus presentation window that is hi
**Inputs-optional** **Inputs-optional**
~~~ ~~~
‘x’ position of scale in X with respect to the center of scale, 0% --> left, 100% --> right 'x' position of scale in X with respect to the center of scale, 0% --> left, 100% --> right
‘y’ position of scale in Y with respect to the center of scale, 0% --> top, 100% --> bottom 'y' position of scale in Y with respect to the center of scale, 0% --> top, 100% --> bottom
width width of scale in percent with respect to screen 'width' width of scale in percent with respect to screen
textSize text size in pixel 'textSize' text size in pixel
penWidth pen width in pixel (for scales) 'penWidth' pen width in pixel (for scales)
color color as RGB triplet 'color' color as RGB triplet
noDivision plot of the sub division lines is disabled. The text of each element is still plotted! 'noDivision' plot of the sub division lines is disabled. The text of each element is still plotted!
active set by default! Sets the scale as active (responses are saved). Only one 'active' set by default! Sets the scale as active (responses are saved). Only one
active scale per screen! Otherwise results are random!! active scale per screen! Otherwise results are random!!
inactive plots scale, but ignores clicks on the screen. Scale is grey to show that 'inactive' plots scale, but ignores clicks on the screen. Scale is grey to show that
it’s not active. This option includes the dontFlip option! That means the it’s not active. This option includes the dontFlip option! That means the
scale isn't plotted on the screen when calling alone. scale isn't plotted on the screen when calling alone.
markText marks the text of the given index in a different color. The index defines 'markText' marks the text of the given index in a different color. The index defines
the position of the text and has to be a scalar. A second argument is the position of the text and has to be a scalar. A second argument is
needed to define the color. Color is represented as RGB triplet. needed to define the color. Color is represented as RGB triplet.
~~~ ~~~
...@@ -178,7 +178,7 @@ Use this function to plot a scale on the stimulus presentation window that is hi ...@@ -178,7 +178,7 @@ Use this function to plot a scale on the stimulus presentation window that is hi
.y the Y position of the point where the user clicked. Zero if the user did not click. .y the Y position of the point where the user clicked. Zero if the user did not click.
.time response time of the user in seconds .time response time of the user in seconds
.escape this entry is set to one if ESC was pressed. .escape this entry is set to one if ESC was pressed.
.click answer in range from 0 left to 1 right. .click answer in range from 0 --> left to 1 --> right.
Negative values means: click left from scale. Negative values means: click left from scale.
Values bigger than one means: click right from scale Values bigger than one means: click right from scale
.index index ranging from 1 to <number of text elements> (for an easier analysis) .index index ranging from 1 to <number of text elements> (for an easier analysis)
...@@ -228,17 +228,17 @@ This is the main function for questionnaires. It needs at least two arguments. I ...@@ -228,17 +228,17 @@ This is the main function for questionnaires. It needs at least two arguments. I
**Inputs-optional** **Inputs-optional**
~~~ ~~~
varargin mainDiv a value in percent that divides the screen vertically into varargin 'mainDiv' a value in percent that divides the screen vertically into
"question part" and answer part" "question part" and answer part"
fontQuest font size for the presented questions 'fontQuest' font size for the presented questions
fontAns font size for the possible answers (presented on top of the chart) 'fontAns' font size for the possible answers (presented on top of the chart)
startX start position in percent of the chart on the screen. 'startX' start position in percent of the chart on the screen.
stopX stop position in percent of the chart on the screen. 'stopX' stop position in percent of the chart on the screen.
penMain pen width in pixel for main question 'penMain' pen width in pixel for main question
penUL pen width in pixel for upper and lower question 'penUL' pen width in pixel for upper and lower question
color color triplet that defines the color for the main question 'color' color triplet that defines the color for the main question
colorful color triplet that defines the color for the upper and lower question 'colorful' color triplet that defines the color for the upper and lower question
topText a text that is presented on top of the questions (if the first 'topText' a text that is presented on top of the questions (if the first
part of the sentence is always the same) part of the sentence is always the same)
~~~ ~~~
...@@ -249,10 +249,10 @@ varargin ‘mainDiv’ a value in percent that divides the screen vertically int ...@@ -249,10 +249,10 @@ varargin ‘mainDiv’ a value in percent that divides the screen vertically int
.x x coordinate of every answer click .x x coordinate of every answer click
.y y coordinate of every answer click .y y coordinate of every answer click
.time reaction time for every answer given .time reaction time for every answer given
.escape changes to ‘1’ if escape was pressed during the experiment (otherwise ‘0’) .escape changes to '1' if escape was pressed during the experiment (otherwise '0')
.click x coordinate of answer in percent (0= most left possible answer field for .click x coordinate of answer in percent (0= most left possible answer field for
clicking, 100= most right possible answer field for clicking) clicking, 100= most right possible answer field for clicking)
.index index of the given answer (‘1’ is first possible answer, ‘2’ is second etc.) .index index of the given answer ('1' is first possible answer, '2' is second etc.)
.question question asked .question question asked
.answer answer given .answer answer given
~~~ ~~~
...@@ -274,11 +274,11 @@ This function creates a box that allows the user to type a free defined word or ...@@ -274,11 +274,11 @@ This function creates a box that allows the user to type a free defined word or
**Inputs** **Inputs**
~~~ ~~~
varargin ‘x’ x Position in percent varargin 'x' x Position in percent
‘y’ y Position in percent (top is 0, bottom is 100) 'y' y Position in percent (top is 0, bottom is 100)
color text color as triplet (RGB) 'color' text color as triplet (RGB)
time maximum time to wait in seconds (default is 30s) 'time' maximum time to wait in seconds (default is 30s)
maxSymbols maximum number of symbols (determines only the size of the box) 'maxSymbols' maximum number of symbols (determines only the size of the box)
~~~ ~~~
**Outputs** **Outputs**
... ...
......