unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, CollisionManager, MyTypes;
type
TForm2 =
class(TForm)
Button1: TButton;
Image1: TImage;
Image2: TImage;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
CollisionManager: TCollisionManager;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var
tempQuad: TQuad;
begin
TempQuad.Lu.x := Image1.Top;
//XWert links Unten
TempQuad.Lu.y := Image1.Left;
//YWert Links Unten
TempQuad.width := Image1.Width;
TempQuad.height:= Image1.Height;
CollisionManager.PointA := TempQuad;
TempQuad.Lu.x := Image2.Top;
//XWert links Unten
TempQuad.Lu.y := Image2.Left;
//YWert Links Unten
TempQuad.width := Image2.Width;
TempQuad.height:= Image2.Height;
CollisionManager.PointB := TempQuad;
if CollisionManager.Collision
then showmessage('
Kollision!');
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
CollisionManager := TCollisionManager.Create;
end;
end.