mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-10 19:35:10 -05:00
Documentation :-)
This commit is contained in:
parent
0f5b52533d
commit
d72d28b154
@ -10,6 +10,11 @@ icon to show at all times.
|
||||
Settings can be changed by going to the menubar titled *Tools* and the
|
||||
selecting the *Settings* option.
|
||||
|
||||
If you at any time have serious problems with Simba not behaving it as you
|
||||
expect it should and you changed something in the settings, you could try
|
||||
closing Simba and deleting ``settings.xml``. Simba will create one with
|
||||
default settings if it does not exist.
|
||||
|
||||
|
||||
General Settings
|
||||
----------------
|
||||
|
@ -1,18 +1,50 @@
|
||||
.. _scriptref_colour:
|
||||
|
||||
|
||||
Colour Finding
|
||||
==============
|
||||
|
||||
Finding colours on the screen is quite simple. Simba offers methods like
|
||||
``FindColor`` to locate colours on the screen.
|
||||
|
||||
These methods are usually composed out of several (but not always all)
|
||||
components:
|
||||
* The colour to search for.
|
||||
* An area to search in, defined by *x1*, *y1*, *x2*, *y2*.
|
||||
* Tolerance applied to the colour matching. With a maximum tolerance all
|
||||
colours are matched.
|
||||
* Spiral. A spiral defines a point where the search will start from.
|
||||
This is particulary useful if you want the first result near specific
|
||||
coordinates.
|
||||
* AreaSize. The size the box of colours should be. Usually this is not
|
||||
adjustable.
|
||||
* A single point in *x*, *y* can be returned, or a set or points called
|
||||
a *TPointArray*.
|
||||
|
||||
.. note::
|
||||
Other techniques exist, which involve relative point distance from one point
|
||||
to another; these are found in the :ref:`_scriptref_DTM` section.
|
||||
|
||||
.. note::
|
||||
|
||||
Although the documentation uses the ``English`` spelling of
|
||||
``colour``; the code for compatibility sake uses ``color``, without the u.
|
||||
|
||||
|
||||
Colour Finding Methods
|
||||
----------------------
|
||||
|
||||
A list of (not yet all) colour finding methods in Simba.
|
||||
A list of all colour finding methods in Simba.
|
||||
|
||||
SimilarColors
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: pascal
|
||||
|
||||
function SimilarColors(C1, C2, Tolerance: Integer): Boolean;
|
||||
|
||||
SimilarColors returns true if the two passed colours are *similar* given the
|
||||
passed tolerance.
|
||||
|
||||
FindColor
|
||||
~~~~~~~~~
|
||||
@ -23,8 +55,10 @@ FindColor
|
||||
Boolean;
|
||||
|
||||
|
||||
FindColor returns true if the exact colour given (col) is found in the box defined by x1, y1, x2, y2.
|
||||
The point is returned in x and y. It searches from the top left to the bottom right and will stop
|
||||
FindColor returns true if the exact colour given (col) is found in the box
|
||||
defined by *x1*, *y1*, *x2*, *y2*.
|
||||
The point is returned in *x* and *y*.
|
||||
It searches from the top left to the bottom right and will stop
|
||||
after matching a point.
|
||||
|
||||
FindColorTolerance
|
||||
@ -36,11 +70,23 @@ FindColorTolerance
|
||||
Integer): Boolean;
|
||||
|
||||
FindColorTolerance returns true if a colour within the given tolerance range
|
||||
(tol) of the given colour (col) is found in the box defined by x1, y1, x2, y2.
|
||||
Only the first point is returned in x and y.
|
||||
Whether or not a colour is within the tolerance range is determined by the :ref:`CTS` mode.
|
||||
It searches from the top left to the bottom right and will stop after matching a point.
|
||||
*tol* of the given colour *col* is found in the box defined by *x1*, *y1*,
|
||||
*x2*, *y2*.
|
||||
Only the first point is returned in *x* and *y*.
|
||||
Whether or not a colour is within the tolerance range is determined by the
|
||||
:ref:`scriptref_CTS` mode. It searches from the top left to the bottom right
|
||||
and will stop after matching a point.
|
||||
|
||||
FindColors
|
||||
~~~~~~~~~~
|
||||
|
||||
.. code-block:: pascal
|
||||
|
||||
function FindColors(var pts: TPointArray; col, x1, y1, x2, y2): Boolean;
|
||||
|
||||
FindColors returns a list of all points that match the colour *col* in an area
|
||||
defined by *x1*, *y1*, *x2*, *y2*. It returns true if one or more points have
|
||||
been found.
|
||||
|
||||
FindColorsTolerance
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
@ -50,7 +96,58 @@ FindColorsTolerance
|
||||
function FindColorsTolerance(var pts: TPointArray; col, x1, y1, x2, y2,
|
||||
tol: Integer): Boolean;
|
||||
|
||||
FindColorsTolerance returns true if at least one point was found. A point is found if it is within the
|
||||
given tolerance range (tol) of the given color (col) and inside the box defined by x1, y1, x2, y2.
|
||||
Whether or not a color is within the tolerance range is determined by the CTS mode.
|
||||
It searches from the top left to the bottom right and will find all matching points in the area.
|
||||
FindColorsTolerance returns true if at least one point was found.
|
||||
A point is found if it is within the given tolerance range *tol*
|
||||
of the given colour *col* and inside the box defined by *x1*, *y1*, *x2*, *y2*.
|
||||
Whether or not a color is within the tolerance range is determined by the
|
||||
:ref:`scriptref_CTS` mode.
|
||||
It searches from the top left to the bottom right and will find all
|
||||
matching points in the area.
|
||||
|
||||
FindColorSpiral
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: pascal
|
||||
|
||||
function FindColorSpiral(var x, y: Integer; color, xs,ys,xe,ye:Integer):
|
||||
Boolean;
|
||||
|
||||
Same as FindColor, but starts searching from *x*, *y*.
|
||||
|
||||
FindColorSpiralTolerance
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: pascal
|
||||
|
||||
function FindColorToleranceSpiral(var x, y: Integer; color,
|
||||
xs,ys,xe,ye,tolerance:Integer): Boolean
|
||||
|
||||
Same as FindColorTolerance, but starts searching from *x*, *y*.
|
||||
|
||||
FindColorsSpiralTolerance
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: pascal
|
||||
|
||||
function FindColorsSpiralTolerance(x, y: Integer;
|
||||
var pts: TPointArray; col, x1, y1, x2, y2, tol: Integer): Boolean;
|
||||
|
||||
Same as FindColorsTolerance, but starts searching from *x*, *y*.
|
||||
|
||||
|
||||
.. _scriptref_CTS:
|
||||
|
||||
Colour tolerance
|
||||
----------------
|
||||
|
||||
Simba contains several algorithms for determining if two colours are equal
|
||||
given a tolerance. There are three algorithms:
|
||||
|
||||
.. XXX FIXME COMPLETE ME
|
||||
|
||||
.. note::
|
||||
This is a stub and needs to be expanded.
|
||||
|
||||
* CTS 0:
|
||||
* CTS 1:
|
||||
* CTS 2:
|
||||
|
Loading…
Reference in New Issue
Block a user