Einzelnen Beitrag anzeigen

Gandalfus

Registriert seit: 19. Apr 2003
407 Beiträge
 
Delphi 2006 Professional
 
#10

Re: Kollisionsabfrage mit Images

  Alt 10. Feb 2004, 15:00
Delphi-Quellcode:
function RectinRect(rect1,rect2: Trect): boolean;
begin
  result := true;
  if (rect1.Left > rect2.BottomRight.x) then result:=false;
  if (rect1.top > rect2.BottomRight.y) then result:=false;
  if (rect2.Left > rect1.BottomRight.x) then result:=false;
  if (rect2.top > rect1.BottomRight.y) then result:=false;
end;

[...]

IF RectinRect(Imag1.clientrect,Image2.clientRect) then Kollision
  Mit Zitat antworten Zitat