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 (basically I try to rebuild spritz.com). 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.
So the question is, how I can align strings on a line with different sources of the string so that a y is on the same line as an o and a d. Now, that lowest pixel of every letter is on the same line but parts of the 'y' have to be kind of lower than a d for example. 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 and whether this would be the solution. Any help is appreciated. All the best, Dominik