-
Notifications
You must be signed in to change notification settings - Fork 1
/
draw_pnline.m
34 lines (26 loc) · 1.17 KB
/
draw_pnline.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
31
32
33
function [] = draw_pnline(w,center,line_w, line_rightshift, col, penThickness, line_h)
% draw a horizontal line of length LINE_W,
% shifted upwards by LINE_UPSHIFT and
% shifted rightwards by LINE_RIGHTSHIFT
% penThickness is thickness of the line
% line_w is width in the number of pixels
% line_rightshift = 0;
line_upshift = 0;
%draw line parameters
fromH1 = center(1) - line_w/2 + line_rightshift; %beginning x of line
fromV1 = center(2) + line_upshift; %beginning y of line
toH1 = center(1) + line_w/2 + line_rightshift; %end x coordinate of line
toV1 = center(2) + line_upshift; %end y coordinate of line
% DrawLine parameters: color, fromH, fromV, toH, toV, penWidth, penHeight
Screen('DrawLine', w ,col,fromH1,fromV1, ...
toH1,toV1, ...
penThickness);
% draw a horizontally-centered, vertical line of length LINE_H shifted upwards by LINE_UPSHIFT
%line_h = 24;%line_h = height of the line in pixels
fromH2 = center(1);
fromV2 = center(2)+line_h;
toH2 = center(1);
toV2 = center(2)-line_h;
Screen('DrawLine', w, col,fromH2,fromV2, ...
toH2,toV2, ...
penThickness);