-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRect.m
34 lines (27 loc) · 960 Bytes
/
Rect.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
34
classdef Rect < CanClone & Target
properties (Constant)
XML_TAG_TARGET_RECT = 'rect';
end
properties (Access = public)
Id;
Height;
Width;
Color;
end
methods (Access = public)
function obj = Rect(xmlNode)
if (nargin == 1)
obj.Id = Utils.strToChar(xmlNode.getAttribute('id'));
obj.Height = Utils.strToDouble(xmlNode.getAttribute('height'));
obj.Width = Utils.strToDouble(xmlNode.getAttribute('width'));
obj.Color = Utils.strToArray(xmlNode.getAttribute('color'));
end
end
function obj = drawOnScreen(obj, window)
if (logical(obj.visibility))
rect = [obj.X obj.Y obj.X+obj.Width obj.Y+obj.Height];
Screen('FillRect', window, obj.Color, rect);
end
end
end
end