MATLAB Answers

KJG
0

Why does DrawFormattedText 'clip' words when they are flipped to screen (in psychtoolbox)?

Asked by KJG
on 5 Mar 2019
Latest activity Answered by Grace Steward on 12 Jul 2019
Hi there,
I've written a piece of code using psychtoolbox that appears to 'clip' only the top half of the instructions when they are flipped to screen. Below is an example of the code:
%load basic parameters for psychotoolbox
PsychDefaultSetup(2);
Screen('Preference', 'SkipSyncTests', 1);
screens = Screen('Screens');
screenNumber = max(screens)
white = WhiteIndex(screenNumber); black = BlackIndex(screenNumber);
[window, windowRect] = PsychImaging('OpenWindow', screenNumber, black);
[screenXpixels, screenYpixels] = Screen('WindowSize', window);
[xCenter, yCenter] = RectCenter(windowRect);
Screen('BlendFunction', window, 'GL_SRC_ALPHA', 'GL_ONE_MINUS_SRC_ALPHA');
%Flip text to screen
[nx, ny, textbounds, wordbounds] = DrawFormattedText(window, 'Hello genius!', 'center', 'center', white);
Screen('Flip', window);
KbStrokeWait; sca;
I've included the global function for disabling the clipping but this doesn't seem to work (ptb_drawformattedtext_disableClipping = 1; ). Clipping appears for every row of my instructions flipped to screen. Does anyone know what is going on?
I'm using matlab 9.4.0.813654 (R2018a), psychtoolbox 3.0.15.
Many thanks!

  0 Comments

Sign in to comment.

1 Answer

Answer by Grace Steward on 12 Jul 2019

Hello,
I had a similar problem, and it turns out that PsychToolbox doesn't handle display scaling well at all. So you might be getting clipping due to your display screen being scaled to something above 100%. You can change that in your display settings panel.
Hope that helps.

  0 Comments

Sign in to comment.