-
Notifications
You must be signed in to change notification settings - Fork 0
/
drawMaskedStimulus.m
30 lines (25 loc) · 1.11 KB
/
drawMaskedStimulus.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function drawMaskedStimulus(window, prompt, eyes,...
imageTex, mondrianTex, alpha_mondrian, alpha_tex, where, maskEye)
for eye = 1:2
Screen('SelectStereoDrawBuffer',window.pointer,eye-1);
if all(eyes)
Screen('DrawTexture', window.pointer, mondrianTex,[],[],[],[],alpha_mondrian);
Screen('DrawTexture', window.pointer, imageTex,[],where,[],[],alpha_tex);
elseif eyes(eye)
Screen('DrawTexture', window.pointer, imageTex,[],where,[],[],alpha_tex);
elseif any(eyes) && ~eyes(eye)
% draw Mondrians
Screen('DrawTexture', window.pointer, mondrianTex,[],[],[],[],alpha_mondrian);
elseif ~any(eyes)
if eye == 2 && strcmp(maskEye,'right')
Screen('DrawTexture', window.pointer, mondrianTex,[],[],[],[],alpha_mondrian);
end
end
% small white fixation square
Screen('DrawLines', window.pointer, window.fixCrossCoords,...
2, window.white, window.center, 2);
% prompt participant to respond
DrawFormattedText(window.pointer, prompt, 'center', window.winRect(4)*.8);
end
Screen('DrawingFinished',window.pointer);
end