Skip to content

Commit

Permalink
fix findObject again.
Browse files Browse the repository at this point in the history
  • Loading branch information
Olly committed Oct 6, 2013
1 parent 3255504 commit ef6b6d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/interfaces/gametabs/gametab.simba
Expand Up @@ -229,6 +229,8 @@ procedure __freeGameTabs();
var
i: integer;
begin
print('Freeing gametabs bitmaps..');

for i := 0 to high(gameTabs.tabs) do
if (gameTabs.tabs[i]._bmpLoaded) then
freeBitmap(gameTabs.tabs[i]._bmp);
Expand Down
8 changes: 4 additions & 4 deletions lib/interfaces/mainscreen.simba
Expand Up @@ -286,11 +286,11 @@ TRSMainscreen.findObject; overload;

.. code-block:: pascal

function TRSMainscreen.findObject(var x, y: integer; col, tol: integer; colSettings: TColorSettings; sortFrom: TPoint; objWidth, objHeight, minCount: integer; mouseOverText: TStringArray; mouseAction: integer = MOUSE_NONE): boolean; overload;
function TRSMainscreen.findObject(var ix, iy: integer; col, tol: integer; colSettings: TColorSettings; sortFrom: TPoint; objWidth, objHeight, minCount: integer; mouseOverText: TStringArray; mouseAction: integer = MOUSE_NONE): boolean; overload;

A very general object finding function. Will find and mouse an object in the mainscreen.

* x, y: The coordinates of the object if found.
* ix, iy: The coordinates of the object if found.
* col: The color to be found.
* tol: The tolerance on 'col'.
* colSettings: The color settings (i.e. color tolerance speed and modifiers). See lib/utilities/color.simba.
Expand All @@ -313,9 +313,9 @@ Example:
if (mainscreen.findObject(x, y, 123457, 10, colorSetting(2, 0.02, 0.13), mainscreen.getCenterPoint(), 50, 25, 40, ['ake'])) then
writeln('Clicked object!');
*)
function TRSMainscreen.findObject(var x, y: integer; col, tol: integer; colSettings: TColorSettings; sortFrom: TPoint; objWidth, objHeight, minCount: integer; mouseOverText: TStringArray; mouseAction: integer = MOUSE_NONE): boolean; overload;
function TRSMainscreen.findObject(var ix, iy: integer; col, tol: integer; colSettings: TColorSettings; sortFrom: TPoint; objWidth, objHeight, minCount: integer; mouseOverText: TStringArray; mouseAction: integer = MOUSE_NONE): boolean; overload;
begin
result := self.findObject(x, y, [col], [tol], colSettings, sortFrom, objWidth, objHeight, minCount, mouseOverText, self.getBounds(), mouseAction);
result := self.findObject(ix, iy, [col], [tol], colSettings, sortFrom, objWidth, objHeight, minCount, mouseOverText, self.getBounds(), mouseAction);
end;

{$IFNDEF CODEINSIGHT}
Expand Down

0 comments on commit ef6b6d9

Please sign in to comment.