caused
2010-03-03 13:56:14
I've always had troubles with the SRL DebugATPABounds function. Now looking at it, I think that this function is somewhat outdated ;)…
Feel free to use this one, if you're having trouble with the usual DebugATPABounds function( Blank debug canvas ).
It also works without SRL.
Example Output:

Feel free to use this one, if you're having trouble with the usual DebugATPABounds function( Blank debug canvas ).
It also works without SRL.
Example Output:

E: Committed{*******************************************************************************
procedure DebugATPABounds(aPoints: Array Of TPointArray);
By: Wizzup?, lordsaturn, & caused
Description: Shows an image of the client, plotting each TPA's bounds as a box
of different colour per TPA. If a name is specified, an image
will be saved.
*******************************************************************************}
procedure DebugATPABounds(aPoints: Array Of TPointArray);
var
Width, Height, ClientBMP, I,x2, y2, h : Integer;
B: TBox;
BoxColors : Array Of Integer;
SelColor: Integer;
begin
{$IFDEF SIMBA}
WriteLn('Ok who''s the lucky guy who wants to make this Simba compatiable? =P - IceFire908 was here xD');
{$ELSE}
GetClientDimensions(x2,y2);
width := x2;
height := y2;
ClientBMP := BitmapFromString(Width, Height, '');
CopyClientToBitmap(ClientBMP, 0, 0, width, height);
DisplayDebugImgWindow(Width, Height);
SafeDrawBitmap(ClientBmp, GetDebugCanvas, 0, 0);
GetDebugCanvas.Font.Style := [fsBold];
GetDebugCanvas.Brush.Style := bsClear;
BoxColors := [clRed, clBlue, clBlack, clGreen, clYellow];
for i:= 0 to high(aPoints) do
begin
SelColor := BoxColors[Random(length(Boxcolors))];
GetDebugCanvas.Pen.Color := SelColor;
GetDebugCanvas.Font.Color := SelColor;
B := GetTPABounds(aPoints[i]);
GetDebugCanvas.Rectangle(B.x1,B.y1,B.x2,B.y2);
GetDebugCanvas.TextOut(B.x1,B.y1,inttostr(i));
end;
FreeBitmap(ClientBmp);
{$ENDIF}
end;
