Hi all!
Hope all is well. I am new to the PsychToolbox, and have been trying to create a full screen string response area. But I seem to be running into an issue getting the text to appear on the screen.
It comes up as a white screen without displaying my prompt text or the text the user enters. I have looked through the documentation and forums, but I still seem to be missing something. If anyone might know where I am making a mistake it would be greatly appreciated. I adapted this off one of the PTB3 tutorials.
On Windows 10, MATLABR2021a, latest PsychToolbox 3
Thank you.
% Clear before starting program
sca;
close all;
clearvars;
% Initialize the base setup
PsychDefaultSetup(2);
%Generate screen numbers for multiple displays
screens = Screen(âScreensâ);
%Choosing minimum will display this on the main laptop screen;
screenNumber = min(screens);
% Define black and white and grey luminance
white = WhiteIndex(screenNumber);
black = BlackIndex(screenNumber);
grey = white / 2;
% Open an on screen window
[window, windowRect] = PsychImaging(âOpenWindowâ, screenNumber);
% This function call will give use the same information as contained in
% âwindowRectâ
rect = Screen(âRectâ, window);
% Get the size of the on screen window in pixels, these are the last two
% numbers in âwindowRectâ and ârectâ
[screenXpixels, screenYpixels] = Screen(âWindowSizeâ, window);
% Get the centre coordinate of the window in pixels.
% xCenter = screenXpixels / 2
% yCenter = screenYpixels / 2
[xCenter, yCenter] = RectCenter(windowRect);
%ScreenSize as reported by the system
[width, height] = Screen(âDisplaySizeâ, screenNumber);
%Function to get user input and display on the screen
[response,temp] = GetEchoString(window,âPlease enter a response.â,xCenter,yCenter,black,[255,255,255]);
% Wait for a keyboard button press to exit
KbStrokeWait;
sca;