NexPB
2012-01-19 16:10:21
I don' rly know hwo to use them and what they will do.
(*
AnimatingMulti
~~~~~~~~~~~~~~
.. code-block:: pascal
function AnimatingMulti(B: TBoxArray; Time, MinCount: Integer): TBooleanArray;
Finds constant animation in boxes B during time T. If PixelShift in box is
smaller than MinCount, it's considered not animating.
.. note::
Author: marpis
Last Modified: Nov. 29, 2009
Example:
.. code-block:: pascal
boolArray := AnimatingMulti(boxArray, 5000, 2000);
for i := 0 to High(boolArray) do
isAnimating := boolArray[i];
*)
function AnimatingMulti(B: TBoxArray; Time, MinCount: Integer): TBooleanArray;
var
Shifts: TIntegerArray;
TT, I, H: Integer;
begin
TT := GetSystemTime + Time;
H := High(B);
SetLength(Result, H + 1);
for I := 0 to H do
Result[I] := True;
while (GetSystemTime < TT) do
begin
Shifts := PixelShiftMulti(B, 50);
for I := 0 to H do
if (Shifts[I] <= MinCount) then
Result[I] := False;
end;
end;
(*
Animating
~~~~~~~~~
.. code-block:: pascal
function Animating(B: TBox; Time, MinCount: Integer): Boolean;
Finds constant animation in boxes B during time T. If PixelShift in box is
smaller than MinCount, it's considered not animating.
.. note::
Author: marpis
Last Modified: Nov. 29, 2009
Example:
.. code-block:: pascal
playerAnimating := Animating(box, 5000, 2000);
*)
function Animating(B: TBox; Time, MinCount: Integer): Boolean;
var
TBA: TBooleanArray;
begin
TBA := AnimatingMulti([B], Time, MinCount);
Result := TBA[0];
end;