Update Text Options: minor text & code adjustments authored by Fabian Berg's avatar Fabian Berg
...@@ -14,8 +14,8 @@ Use this function to plot a text on the presentation window. A wrapper function ...@@ -14,8 +14,8 @@ 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
...@@ -58,8 +58,8 @@ Use this function to plot a text on the presentation window. A wrapper function ...@@ -58,8 +58,8 @@ Use this function to plot a text on the presentation window. A wrapper function
% Draws the string "Hello World" starts at left side of the monitor % Draws the string "Hello World" starts at left side of the monitor
4. showText('Hello World', 'y', 80, 'key'); 4. showText('Hello World', 'y', 80, 'key');
% Draws the string "Hello World" at position center/bottom and waits for the user to % % Draws the string "Hello World" at position center/bottom and waits for the user to
press a key. % press a key.
5. showText('Hello World', 'wrapat', 5) 5. showText('Hello World', 'wrapat', 5)
% Draws the string Hello World on the middle of the screen and wraps it after 5 % Draws the string Hello World on the middle of the screen and wraps it after 5
...@@ -105,10 +105,10 @@ Use this function to display instructions or information to a subject. The text ...@@ -105,10 +105,10 @@ Use this function to display instructions or information to a subject. The text
**Examples** **Examples**
~~~matlab ~~~matlab
1. showInstructions('instruction1.txt') 1. showInstructions('instruction1.txt')
% displays the text of the given file % displays the text of the given file
2. showInstructions('This is my example text') 2. showInstructions('This is my example text')
% displays the text that is given as string % displays the text that is given as string
~~~ ~~~
## fixationCross ## fixationCross
...@@ -130,10 +130,10 @@ Draws a white fixations cross on the screen and waits specified time ...@@ -130,10 +130,10 @@ Draws a white fixations cross on the screen and waits specified time
**Examples** **Examples**
~~~matlab ~~~matlab
1. fixationCross(2); 1. fixationCross(2);
% Presents the fixation cross for 2 seconds % Presents the fixation cross for 2 seconds
fixationCross(1.5, 'color', [255 0 0]); fixationCross(1.5, 'color', [255 0 0]);
% Presents the fixation cross in red for 1.5 seconds % Presents the fixation cross in red for 1.5 seconds
~~~ ~~~
## plotScale (human) ## plotScale (human)
...@@ -187,19 +187,19 @@ Use this function to plot a scale on the stimulus presentation window that is hi ...@@ -187,19 +187,19 @@ Use this function to plot a scale on the stimulus presentation window that is hi
**Examples** **Examples**
~~~matlab ~~~matlab
1. out = plotScale(5, {'1', '2', '3', '4', '5'}, 'y', 70, 'color', [255 0 255]); 1. out = plotScale(5, {'1', '2', '3', '4', '5'}, 'y', 70, 'color', [255 0 255]);
% Plots a scale in the lower middle of the screen with the values % Plots a scale in the lower middle of the screen with the values ranging from 1 to 5.
ranging from 1 to 5. The scale is displayed 5 seconds or until the user responds. % The scale is displayed 5 seconds or until the user responds.
2. out = plotScale(5, {'1', '2', '3', '4', '5'},'penWidth',5,'textSize',50); 2. out = plotScale(5, {'1', '2', '3', '4', '5'},'penWidth',5,'textSize',50);
% Plots a scale in the middle of the screen with the values % Plots a scale in the middle of the screen with the values ranging from 1 to 5.
ranging from 1 to 5. The scale is displayed 5 seconds or until the % The scale is displayed 5 seconds or until the user responds.
user responds. The command changes the pen width to 5 and the text size to 50. % The command changes the pen width to 5 and the text size to 50.
~~~ ~~~
![image](uploads/f1a6a47cb52b282623658fe1736d63d1/image.png) ![image](uploads/f1a6a47cb52b282623658fe1736d63d1/image.png)
~~~matlab ~~~matlab
3. out = plotScale(inf, {'a','b','c','d','e','f','g'}); 3. out = plotScale(inf, {'a','b','c','d','e','f','g'});
% Plots a scale ranging from a to g in the middle of the screen % Plots a scale ranging from a to g in the middle of the screen (default values).
(default values). The display time is set to infinity. That means the user has to respond. % The display time is set to infinity. That means the user has to respond.
4. out = plotScale(10, {'Very\nlong\ntext', 'short1', 'short2', 'very long\n again'}) 4. out = plotScale(10, {'Very\nlong\ntext', 'short1', 'short2', 'very long\n again'})
% Example for the usage of new lines (\n) in the text. % Example for the usage of new lines (\n) in the text.
...@@ -207,7 +207,7 @@ Use this function to plot a scale on the stimulus presentation window that is hi ...@@ -207,7 +207,7 @@ Use this function to plot a scale on the stimulus presentation window that is hi
5. plotScale(inf, {'a','b','c','d','e','f','g'}, 'y', 70, 'inactive', 'dontFlip', 'color', [128 128 128]); 5. plotScale(inf, {'a','b','c','d','e','f','g'}, 'y', 70, 'inactive', 'dontFlip', 'color', [128 128 128]);
out = plotScale(inf, {'a','b','c','d','e','f','g'}); out = plotScale(inf, {'a','b','c','d','e','f','g'});
% Plots two scales on the screen, but only the first is active. % Plots two scales on the screen, but only the first is active.
Plotting the inactive Scale has to be done first (dontFlip)!!! % Plotting the inactive Scale has to be done first (dontFlip)!!!
6. out = plotScale(10, {'a','b','c','d','e','f','g'}, 'markText', [2 5], [255 0 0]); 6. out = plotScale(10, {'a','b','c','d','e','f','g'}, 'markText', [2 5], [255 0 0]);
% Plots a scale in the middle of the screen and the characters b and e are marked in red. % Plots a scale in the middle of the screen and the characters b and e are marked in red.
...@@ -259,8 +259,8 @@ varargin ‘mainDiv’ a value in percent that divides the screen vertically int ...@@ -259,8 +259,8 @@ varargin ‘mainDiv’ a value in percent that divides the screen vertically int
**Examples** **Examples**
~~~matlab ~~~matlab
1. out=startQuestionnaire({What is blue?, What is salty?, What is music?}, {taste, 1. out=startQuestionnaire({'What is blue?', 'What is salty?', 'What is music?'}, {'taste',
color, smell, sound}); 'color', 'smell', 'sound'});
~~~ ~~~
![image](uploads/863feca79e882da058471f6dba3e0e01/image.png) ![image](uploads/863feca79e882da058471f6dba3e0e01/image.png)
... ...
......