(Moderator)
Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.858 Beiträge
Delphi 11 Alexandria
|
Re: break it problem
31. Jan 2010, 18:41
Die Konstanten waren für den Wert 5 gedacht.
Delphi-Quellcode:
x:=DX;
y:=dy;
if (Shape1.Top <= 0) or (Shape1.Top >= image1.ClientHeight - Shape1.Height) then
begin
y := -dy;
end;
if (Shape1.Left <= 0) or (Shape1.Left >= image1.ClientWidth - Shape1.Width) then
begin
x := -dx;
end;
Shape1.Left := Shape1.Left + x;
Shape1.Top := Shape1.Top + y;
Markus Kinzler
|