Hi everyone,
I am trying to center individual sentences on the screen that together form a block of text (like a passage). I am first drawing “censored” sentences (with some words missing) and then replacing them one-by-one by the full, uncensored text.
For visual reference:
However, when I “uncensor” the sentences, the sentences are no longer centered – everything is skewed to the left and I can’t figure out why this is the case.
Any suggestions to obtain our desired behavior?
Here is a snippet of the code that I am using:
% Draw masked passage based on current trial number
for maskedSentenceCount = 1:13
if maskedSentenceCount > TrialIndex % plot the masked sentences
DrawFormattedText(window,CurrentPassageMasked{maskedSentenceCount},'center',yCenter*TextPlacement(maskedSentenceCount), [1 1 1]);
elseif maskedSentenceCount < TrialIndex % plot the green sentences
DrawFormattedText(window,CurrentPassage{maskedSentenceCount},'center',yCenter*TextPlacement(maskedSentenceCount), [0 1 0]);
endif
endfor
Both calls to DrawFormattedText use the same yCenter value and TextPlacement multiplier.
I am assuming this has something to do with the different sentence arrays that I’m pulling from (one censored and one uncensored), but even the green sentences are all in different horizontal positions. None of the uncensored sentences appear centered even though ALL of the white text is centered before “unmasking”.
I am running this in Ubuntu using Octave (v. 6.4.0) with Psychtoolbox version 3.0.18.
Thank you in advance!