ВУЗ:
Составители:
Рубрика:
17
function TSprite.Move(const drift:Types.TSize):boolean;
var NewPos:Types.TPoint;VisState:Boolean;
begin
Result:=true;
NewPos:=Types.Point(FLocation.X+drift.cx,FLocation.Y+drift.cy);
if Assigned(FOnMove) then Result:=FOnMove(Self,NewPos);
Result:=Result and Contains(
Types.Rect(NewPos.X,NewPos.Y,NewPos.X+FSize.cx,NewPos.Y+FSize.cy),
FSpriteList.FClientRect);
if Result then
begin
VisState:=FVisible;
Visible:=false;
FLocation:=NewPos;
Visible:=VisState
end
end {TSprite.Move};
function TSprite.MoveTo(const NewLocation:Types.TPoint):boolean;
begin
Result:=Move(Types.TSize(
Types.Point(NewLocation.X-FLocation.X,NewLocation.Y-FLocation.Y)))
end {MoveTo};
procedure TSprite.BeginPaint;
var i:integer;
begin
SetMask(FZ);
for i:=FSpriteList.FCount-1 downto FZ+1 do
with FSpriteList[i] do
if FMask and FVisible then Restore;
end {BeginPaint};
procedure TSprite.SetMask(const aZ:integer);
var i:integer;
begin
for i:=aZ+1 to FSpriteList.FCount-1 do
begin
with FSpriteList[i] do
FMask:= Intersect(aZ,i) or FMask;
if FMask then SetMask(i)
end
end {SetMask};
procedure TSprite.EndPaint;
Страницы
- « первая
- ‹ предыдущая
- …
- 15
- 16
- 17
- 18
- 19
- …
- следующая ›
- последняя »
