How can I align multiple characters in Psychtoolbox?

5 views (last 30 days)
Hi,
I am super new to MatLab and I'm currently sitting in front of my computer and don't know how to solve the problem.
I do plan to show my participants a string where one letter (position of the letter varies) has to be at a certain position on the screen and has a different color on the screen, letters before and letters after have to be oriented depending on the position of that letter and are in a different color. So far so good, I know how to align the snippets that they dont overlap horizontally. But I do not know how to deal with letters that have a different size (for example: 'y' vs. 'd' vs. 'o'), because they will have a different position and for the participant, they do not appear to be in the same line.
Thats my simplified code I've got so far:
[nxORP, nyORP, wb] = DrawFormattedText2('p',...
'win', w1, 'sx', 960, 'sy', 553, 'xalign', 'left', 'yalign', 'bottom');
DrawFormattedText2('d',...
'win', w1, 'sx', wb(1), 'sy', 553, 'xalign', 'right', 'yalign', 'bottom');
DrawFormattedText2('y',...
'win', w1, 'sx', wb(3), 'sy', 553, 'xalign', 'left', 'yalign', 'bottom');
Anyone out there can help me?
PS: in the help of http://psychtoolbox.org/docs/DrawFormattedText2 I saw this: "So to use (nx,ny) as the new start position for connecting further text strings, you need to draw these strings with yPositionIsBaseline==true." but I do not know how to do this.
Any help is appreciated.
All the best,
Dominik
  1 Comment
Walter Roberson
Walter Roberson on 23 Jan 2019
Really this is a question for PTB forums, as it concerns only routines that are supplied by the toolbox.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!