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: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76:
| unit U_cockpit;
interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls;
type Tpit = class(TObject)
private x,y:integer; public procedure cockpitzeichnen(xkord,ykord:integer;canv:TCanvas;name:string); procedure zeigerzeichnen(canv:Tcanvas;hoehe,coolness,speed:integer);
end;
implementation
procedure Tpit.cockpitzeichnen(xkord,ykord:integer;canv:TCanvas;name:string); begin x:=xkord; y:=ykord; with canv do begin Brush.Color:=clwhite; pen.color:=clblack; MoveTo(x,y+20); LineTo(x+200,y); LineTo(x+600,y); LineTo(x+800,y+20); TextOut(x+5,y+30,name); TextOut(x+287,y+3,'Höhe'); TextOut(x+480,y+3,'Coolness'); TextOut(x+385,y+86,'Speed'); MoveTo(x+200,y); LineTo(x+200,y+200); MoveTo(x+600,y); LineTo(x+600,y+200);
Brush.Color:=clBtnShadow; Ellipse(x+280,y+20,x+320,y+60); Ellipse(x+480,y+20,x+520,y+60); Ellipse(x+360,y+5,x+440,y+85); end; end;
procedure Tpit.zeigerzeichnen(canv:Tcanvas;hoehe,coolness,speed:integer); var winkel,winkel2,winkel3:integer; begin with canv do begin winkel:=-(hoehe+450)*3; MoveTo(x+300,y+40); lineto(trunc((x+300)-sin(winkel/360)*2*pi*3),trunc((y+40)-cos(winkel/360)*2*pi*3)); winkel2:=-(coolness+450)*3; MoveTo(x+500,y+40); lineto(trunc((x+500)-sin(winkel2/360)*2*pi*3),trunc((y+40)-cos(winkel2/360)*2*pi*3)); winkel3:=-(speed+450)*3; MoveTo(x+400,y+45); lineto(trunc((x+400)-sin(winkel3/360)*2*pi*5),trunc((y+45)-cos(winkel3/360)*2*pi*5)); end; end; end. |