Добавил:
Kaz
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:АСОИ, Delphi, много вариантов 2 сем / 1классы / Квадратные лица / UFACE
.pas unit UFACE;
interface
uses Graphics,UKVAD;
Type TFACE=Class(TKVAD)
EyeColor:TColor;
HeightEye1,HeightEye2:byte;
xi:integer;
Constructor Create(x0,y0:integer;Canvas0:TCanvas);
procedure Show; override;
procedure Levo;
procedure Pravo;
procedure NormEyes;
end;
implementation
Constructor TFACE.Create;
begin
Inherited Create(x0,y0,30,clYellow,Canvas0);
NormEyes
end;
procedure TFACE.NormEyes;
begin
EyeColor:=clBlue;
HeightEye1:=3; HeightEye2:=3;
Show;
end;
procedure TFACE.Show;
var
xi,yi,h,i:integer;
begin
Inherited Show;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-10,yi-h,xi+10,yi+h);
end;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-2,yi-2,xi+2,yi+2);
end;
Canvas.Arc(x-20,y-25,x+20,y+15,x-25,y+10,x+25,y+10);
end;
procedure TFACE.Levo;
var
xi,yi,h,i:integer;
begin
Canvas.Pen.Color:=clYellow;
Canvas.Brush.Color:=clYellow;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-1,yi-2,xi+5,yi+2);
end;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-2,yi-2,xi+2,yi+2);
end;
Canvas.Pen.Color:=clRed;
Canvas.Brush.Color:=clRed;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-5,yi-2,xi+1,yi+2);
end;
end;
procedure TFACE.Pravo;
var
xi,yi,h,i:integer;
begin
Canvas.Pen.Color:=clYellow;
Canvas.Brush.Color:=clYellow;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-5,yi-2,xi+1,yi+2);
end;
Canvas.Pen.Color:=clRed;
Canvas.Brush.Color:=clRed;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-1,yi-2,xi+5,yi+2);
end;
end;
end.
interface
uses Graphics,UKVAD;
Type TFACE=Class(TKVAD)
EyeColor:TColor;
HeightEye1,HeightEye2:byte;
xi:integer;
Constructor Create(x0,y0:integer;Canvas0:TCanvas);
procedure Show; override;
procedure Levo;
procedure Pravo;
procedure NormEyes;
end;
implementation
Constructor TFACE.Create;
begin
Inherited Create(x0,y0,30,clYellow,Canvas0);
NormEyes
end;
procedure TFACE.NormEyes;
begin
EyeColor:=clBlue;
HeightEye1:=3; HeightEye2:=3;
Show;
end;
procedure TFACE.Show;
var
xi,yi,h,i:integer;
begin
Inherited Show;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-10,yi-h,xi+10,yi+h);
end;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-2,yi-2,xi+2,yi+2);
end;
Canvas.Arc(x-20,y-25,x+20,y+15,x-25,y+10,x+25,y+10);
end;
procedure TFACE.Levo;
var
xi,yi,h,i:integer;
begin
Canvas.Pen.Color:=clYellow;
Canvas.Brush.Color:=clYellow;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-1,yi-2,xi+5,yi+2);
end;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-2,yi-2,xi+2,yi+2);
end;
Canvas.Pen.Color:=clRed;
Canvas.Brush.Color:=clRed;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-5,yi-2,xi+1,yi+2);
end;
end;
procedure TFACE.Pravo;
var
xi,yi,h,i:integer;
begin
Canvas.Pen.Color:=clYellow;
Canvas.Brush.Color:=clYellow;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-5,yi-2,xi+1,yi+2);
end;
Canvas.Pen.Color:=clRed;
Canvas.Brush.Color:=clRed;
For i:=1 to 2 do begin
case i of
1: begin
xi:=x-15;
h:=HeightEye1;
end;
2: begin
xi:=x+15;
h:=HeightEye2;
end;
end;
yi:=y-10;
Canvas.Ellipse(xi-1,yi-2,xi+5,yi+2);
end;
end;
end.
Соседние файлы в папке Квадратные лица