SRL Archive - OSR Help

How to draw ATPA bounds inside Smart Client?


johnbrown8976

2012-04-13 00:16:35


{*******************************************************************************
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.
*******************************************************************************}

//I used Wizzup procedure as a base to create this Procedure which does not work
//All credits goes to Wizzup, Hope it is not called plagiarism
Procedure DebugATPABounds1(atpa:T2DPointArray);
var
i, length: Integer;
B: TBox;
begin
length := High(atpa);
for i:=0 to length do
begin
B := GetTPABounds(atpa[i]);
SMART_DrawBox(B);
end;
end;
Source: Debug.simba by Wizzup

I wanted to create a debug boxes inside SMART which shows the boundaries of all TPAs of the given ATPA, I tried to modify the script to draw the debug box images inside the smart but did not work.

Does Simba have predefined function/includes to do so? I have seen these Debug images inside SMART in MSI scripts, anybody could help me please?

Flight

2012-04-13 00:23:18

So that Procedure does not work? What's it not doing correctly?

johnbrown8976

2012-04-13 00:31:46

From: Flight
So that Procedure does not work? What's it not doing correctly?


My modified procedure did not draw the boxes around boundaries of all TPAs of the ATPA.

However, the problem is fixed because SMART has a function SMART_DebugATPA() which does what exactly I wanted, Draw the boxes boundaries of all TPAs inside the SMART window.

I should have researched more before asking in forum. My bad.

Flight

2012-04-13 00:40:21

This is because "SMART_DrawBox" clears the screen when called, therefore you'll only ever see just one box, if any. Try this instead:

Procedure DebugATPABounds1(atpa:T2DPointArray);
var
i, length: Integer;
B: TBox;
begin
length := High(atpa);
for i:=0 to length do
begin
B := GetTPABounds(atpa[i]);
SMART_DrawBoxEx(False, B, clRed);
end;
end;

johnbrown8976

2012-04-13 15:50:00

From: Flight
This is because "SMART_DrawBox" clears the screen when called, therefore you'll only ever see just one box, if any. Try this instead:

Procedure DebugATPABounds1(atpa:T2DPointArray);
var
i, length: Integer;
B: TBox;
begin
length := High(atpa);
for i:=0 to length do
begin
B := GetTPABounds(atpa[i]);
SMART_DrawBoxEx(False, B, clRed);
end;
end;


Thanks for the fix Flight, It works perfect now.