Скачиваний:
11
Добавлен:
15.06.2014
Размер:
949 б
Скачать
unit MyRec;

interface
Uses Graphics;
Type TRec=class(Tobject)
x,y,r: integer;
color: Tcolor;
canvas: Tcanvas;
constructor create(x0,y0,r0: integer; color0: Tcolor; canvas0: Tcanvas);
procedure move(dx,dy: integer);virtual;
procedure show(Col1,Col2:Tcolor); virtual;
end;


implementation
Constructor TRec.Create;
begin

inherited Create;
X:=x0;
y:=y0;
r:=r0;
Color:=Color0;
Canvas:=Canvas0;
end;

Procedure TRec.Show(Col1,Col2:Tcolor);
var
x1,y1:word;
begin
With Canvas do begin
pen.Color:=Col1;
Brush.Color:=Col2;
x1:=x-50;
y1:=y-100;
{Moveto(x1,y1);}
Rectangle(X1,Y1-10,X1+100,Y1+210);
{Lineto(x1+100,y1);
lineto(x1+100,Y1+200);
Lineto(x1,y1+200);
Lineto(x1,y1);}
end;
end;

Procedure TRec.move(dx,dy: integer);
begin
Show(clWhite,clWhite);
X:=X+dx;
Y:=y+dY;
Show(clBlack,Color);
end;

end.
Соседние файлы в папке Машинка с фарами
  • #
    15.06.20141.28 Кб11Main.~dfm
  • #
    15.06.20143.77 Кб11MyCar.dcu
  • #
    15.06.20142.22 Кб11MyCar.pas
  • #
    15.06.20142.22 Кб12MyCar.~pas
  • #
    15.06.20141.96 Кб11MyRec.dcu
  • #
    15.06.2014949 б11MyRec.pas
  • #
    15.06.2014946 б11MyRec.~pas