Скачиваний:
10
Добавлен:
15.06.2014
Размер:
2.25 Кб
Скачать
unit Unit2;
interface

uses graphics,Types;
var colorback:Tcolor;

type
krug=class(Tobject)
x,y,a,b:word;
color1:Tcolor;
Canvas:Tcanvas;
Constructor Create(x0,y0,a0,b0:word; color0:Tcolor; Canvas0:Tcanvas);
procedure make; virtual;
procedure draw(bol:boolean);
procedure show;
procedure hide;
procedure changesize(dx,dy,dr:integer);
end;

treu=class(krug)
high:word;
Constructor Create(x0,y0,a0,b0,high0:word; color0:Tcolor; Canvas0:Tcanvas);
procedure make; override;
end;

sharik=class(treu)
lengthline:word;
Constructor Create(x0,y0,a0,b0,high0,lengthline0:word; color0:Tcolor; Canvas0:Tcanvas);
procedure make; override;
end;

implementation

var be:array[1..3] of TPoint;

Constructor krug.Create;
begin
x:=x0; y:=y0; a:=a0; b:=b0; color1:=color0; Canvas:=Canvas0;
end;

procedure krug.make;
begin
Canvas.Ellipse(x-b,y+a,x+b,y-a);
end;

procedure krug.draw;
begin
if bol then with Canvas do begin
pen.color:=color1; brush.color:=color1;
end
else with Canvas do begin
pen.Color:=colorback; brush.Color:=colorback;
end;
make;
end;

procedure krug.show;
begin
draw(true);
end;

procedure krug.hide;
begin
draw(false);
end;

procedure krug.changesize;
begin
x:=x+dx; y:=y+dy; a:=a+dr; b:=b+dr;
end;

constructor treu.Create;
begin
inherited create(x0,y0,a0,b0,color0,Canvas0);
high:=high0;
end;

procedure treu.make;
begin
inherited make;
with Canvas do begin
be[1]:=point(x,y+a);
be[2]:=point(x+high,y+high+a);
be[3]:=point(x-high,y+high+a);
polygon(be);
end;
end;

constructor sharik.Create;
begin
lengthline:=lengthline0;
inherited create(x0,y0,a0,b0,high0,Color0,Canvas0);
end;

procedure sharik.make;
begin
inherited make;
with Canvas do begin
moveto(x,y+a+high);
lineto(x,y+a+high+lengthline);
end;
end;


end.
Соседние файлы в папке Копия шарик красиво лопается
  • #
    15.06.20147.28 Кб10Unit1.dcu
  • #
    15.06.20142.56 Кб10Unit1.dfm
  • #
    15.06.20143.55 Кб10Unit1.pas
  • #
    15.06.20143.55 Кб11Unit1.~pas
  • #
    15.06.20143.78 Кб11Unit2.dcu
  • #
    15.06.20142.25 Кб10Unit2.pas
  • #
    15.06.20142.09 Кб10Unit2.~pas