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
|
procedure Horloge.onEnterFrame;
var i:integer;
fig:TArrayofPoint;
begin
d:=TDate.Create;
with espace do
begin
clear;
fig := Rrotationarraypoint(0,0,2*pi*(d.getMinutes+d.getSeconds/60)/60,Gaiguille);
linestyle(3,$000000);
beginfill($FFD700);
moveto(Fig[0].x,Fig[0].y);
for i:=1 to 4 do lineto(Fig[i].x,Fig[i].y);
endFill();
//petite aiguille
fig :=Rrotationarraypoint(0,0,2*pi*(d.getHours+d.getMinutes/60)/12,Paiguille);
beginFill($FFD700);//ici j'avais oublié espace.
moveto(Fig[0].x,Fig[0].y);
for i:=1 to 4 do lineto(Fig[i].x,Fig[i].y);
endfill();
//trotteuse
linestyle(4,$FF4500);
beginfill($FF4500);
Rcircle(0,0,2);
RLine(0,0,42*cos(-2*pi*d.getSeconds/60+pi/2),42*sin(-2*pi*d.getSeconds/60+pi/2));
RLine(0,0,-7*cos(-2*pi*d.getSeconds/60+pi/2),-7*sin(-2*pi*d.getSeconds/60+pi/2));
endFill();
end;
RTextout(-10.75,-28,250,30,0,myfont2,IntToStr2(d.getHours)+#32#58#32+IntToStr2(d.getMinutes)+#32#58#32+IntToStr2(d.getSeconds));
end; |
Partager