Hi everyone!
I am trying to present the words in sentences word-by word at the centre of the screen. it works well but I noticed that the centred words are not horizontally aligned because the text bounds are different for words (e.g, “one” and “fog” have different heights) so when display words at the centre, it looks like the words are jumping around.
So how I can fix the problem to make the words are aligned at the letter bottom line?
I am also attching the current function for drawing centred text here.
Many thanks in advance!
function drawcenteredtext_dot(w,str,x,y,color,textsize)
str=double(str);
oldsize=Screen('TextSize',w,textsize);
drect=Screen('TextBounds',w,str);
sx=x-drect(3)/2;
sy=y-drect(4)/2;
Screen('DrawText',w,str,sx,sy,color);
Screen('TextSize',w,oldsize);