Paint Smart

The Paint Smart include contains functions that will paint graphics on to the SMART screen. Used to make scripts look nicer and sometimes to display progress reports. Also used as a useful debugging tool. This is for Simba 0.98 and earlier.

SMART_SetupDebug

procedure SMART_SetupDebug();

Declares the SMART_Canvas bitmap. Does not need to be called in scripts as it’s called in the SMART_ functions automatically.

Note

Author: Coh3n Last Modified: Unknown

Example:

if (not SMART_DebugSetup) then
  SMART_SetupDebug();

SMART_ClearCanvasArea

procedure SMART_ClearCanvasArea(Area: TBox);

Clears a specific area of the SMART canvas defined by the box, ‘Area’.

Note

Author: Coh3n Last Modified: January 10th, 2012 by Coh3n

Example:

SMART_ClearCanvasArea(IntToBox(10, 10, 50, 50));

SMART_ClearCanvas

procedure SMART_ClearCanvas;

Clears the entire SMART canvas.

Note

Author: Coh3n Last Modified: January 10th, 2012 by Coh3n

Example:

SMART_ClearCanvasArea();

SMART_ClearMS

procedure SMART_ClearMS;

Clears the mainscreen section of the SMART canvas.

Note

Author: mormonman Last Modified: January 20th, 2012

Example:

SMART_ClearMS;

SMART_DrawDotsEx

procedure SMART_DrawDotsEx(Clear: boolean; pixels: TPointArray; color: TColor);

Draws a colored (color) TPA onto the SMART canvas. Will clear the canvas if ‘Clear’ is set to true.

Note

Author: Sir R. Magician Last Modified: Unknown

Example:

SMART_DrawDotsEx(true, TPA, clRed);

SMART_DrawDotsMulti

procedure SMART_DrawDotsMulti(Clear: boolean; pixels : T2DPointArray);

Draws an ATPA onto the SMART canvas. Will clear the canvas if ‘Clear’ is set to true.

Note

Author: Sir R. Magician Last Modified: January 20th, 2012 by mormonman

Example:

SMART_DrawDotsMulti(true, ATPA);

SMART_DebugATPA

procedure SMART_DebugATPA(Clear: Boolean; ATPA: T2DPointArray);

Draws the box of each TPA in the ATPA and write the index number in the top left corner and a cross at the point found by MiddleTPA.

Note

Author: mormonman Last Modified: January 20, 2012

Example:

SMART_DebugATPA(True, ATPA);

SMART_DebugTPA

procedure SMART_DebugTPA(Clear: Boolean; TPA: TPointArray);

Draws the TPA bounds and puts a cross at the point created by MiddleTPA.

Note

Author: mormonman Last Modified: January 12, 2012

Example:

SMART_DebugTPA(True, TPA);

SMART_DrawDots

procedure SMART_DrawDots(Dots: TPointArray);

Clears the SMART canvas, then draws a red TPA (Dots).

Note

Author: Sir R. Magician Last Modified: Unknown

Example:

SMART_DrawDots(TPA);

SMART_DrawDot

procedure SMART_DrawDot(Clear: Boolean; Point: TPoint; Color: TColor);

Draws a single colored dot (Color) at the set point (Point) on the SMART canvas. Will clear the SMART canvas if set to do so (Clear).

Note

Author: Coh3n Last Modified: January 10th, 2012

Example:

SMART_DrawDot(true, point(10, 10), clGreen);

SMART_DrawBoxes

procedure SMART_DrawBoxes(Clear: Boolean; TBA: TBoxArray; Color: Integer);

Draws an array of boxes onto the SMART canvas. Set Color to -1 for it to use different colors (like in SMART_DrawDotsMulti).

Note

Author: mormonman Last Modified: January 10th, 2012

Example:

SMART_DrawBoxes(true, TBA, -1);

SMART_DrawBoxEx

procedure SMART_DrawBoxEx(Clear: boolean; Box: TBox; color: TColor);

Draws a single colored (color) box (Box) on the SMART canvas. Will clear the canvas if set to do so (Clear).

Note

Author: mormonman Last Modified: January 10th, 2012

Example:

SMART_DrawBoxEx(true, intToBox(50, 50, 100, 100), clGreen);

SMART_DrawBox

procedure SMART_DrawBox(Box: TBox);

Clears the SMART canvas, then draws a single red box, specified by ‘Box’.

Note

Author: mormonman Last Modified: January 10th, 2012

Example:

SMART_DrawBox(intToBox(50, 50, 100, 100));

SMART_DrawBoxMS

procedure SMART_DrawBoxMS(Clear: Boolean; Box: TBox; Color: TColor);

Draws a box on the RS mainscreen, even if the coordinates are outside client boundaries.

Note

Author: Coh3n Last Modified: Unknown

Example:

SMART_DrawBoxMS(true, intToBox(50, 50, 100, 100), clBlue);

SMART_DrawLine

procedure SMART_DrawLine(Clear: Boolean; TP1, TP2: TPoint; Color: TColor);

Draws a line a set color (Color) from point 1 (TP1) to point 2 (TP2). Will clear the SMART canvas if set to do so (Clear).

Note

Author: mormonman Last Modified: January 10th, 2012

Example:

SMART_DrawLine(true, point(10, 10), point(10, 50), clWhite);

SMART_DrawEllipse

procedure SMART_DrawEllipse(Clear: Boolean; Center: TPoint; XRadius, YRadius: Integer; Fill: Boolean; Color: TColor);

Draws an ellipse on the SMART canvas defined by ‘Center’, ‘XRadius’, and ‘YRadius’. If ‘Fill’ is true it will fill the ellipse, otherwise it draws just the border. Will clear the SMART canvas if set to do so (Clear).

Note

Author: mormonman Last Modified: January 20th, 2012

Example:

SMART_DrawEllipse(true, point(300, 300), 35, 35, true, clYellow);

SMART_DrawCircle

procedure SMART_DrawCircle(Clear: Boolean; Center: TPoint; Radius: Integer; Fill: Boolean; Color: TColor);

Draws a circle on the SMART canvas defined by ‘Center’ and ‘Radius’. If ‘Fill’ is true it will fill the circle, otherwise it draws just the border. Will clear the SMART canvas if set to do so (Clear).

Note

Author: mormonman Last Modified: January 10th, 2012

Example:

SMART_DrawCircle(true, point(300, 300), 35, true, clYellow);

SMART_DrawPolygons

procedure SMART_DrawPolygons(Clear: Boolean; Polygons: T2DPointArray; color: TColor);

Draws an array of polygons on the SMART canvas in the set color. Will clear the SMART canvas if set to do so (Clear).

Note

Author: mormonman Last Modified: January 10th, 2012

Example:

SMART_DrawPolygons(true, ATPA, clBlue);

SMART_DrawTextMulti

procedure SMART_DrawTextMulti(Clear, Shadow: Boolean; TSA: TStringArray; Placement: TPoint; Font: string; Colour: TColor);

Draws text on the SMART canvas. Used mainly for progress reports. Parameters are as follows:

  • Clear: Clear the SMART canvas before drawing
  • Shadow: if set to true, will add a shadow to the text
  • TSA: the string array of what to be printed; each element is a different line
  • Placement: the point to start the text drawing
  • Font: the font to use (see Simba/Fonts/)
  • Colour: the color of the font

Note

Author: Flight & Coh3n Last Modified: January 20th, 2012 by mormonman

Example:

SMART_DrawTextMulti(true, true, ['Time Run: '+TimeRunning', 'Logs Chopped: 10'], Point(10, 10), LoginChars, clRed);

SMART_DrawTextEx

procedure SMART_DrawTextEx(Clear: Boolean; x, y: Integer; font, Text: string; Color: TColor);
Draws shadowed line of text on the SMART canvas. Parameters are as follows:
  • Clear: Clear the SMART canvas before drawing
  • x, y: the coords of where to place the text
  • font: the font to use (see Simba/Fonts/)
  • Text: the text to draw to the SMART canvas
  • Colour: the color of the font

Note

Author: Coh3n Last Modified: January 10th, 2012 by Coh3n

Example:

SMART_DrawTextEx(true, 10, 10, StatChars, 'Testing!', clBlue);

SMART_DrawText

procedure SMART_DrawText(x, y: Integer; font, Text: string; Color: TColor);

Same as SMART_DrawTextEx, except clears the canvas before drawing.

Note

Author: Coh3n Last Modified: January 10th, 2012 by Coh3n

Example:

SMART_DrawText(10, 10, StatChars, 'Testing!', clBlue);

SMART_DrawBitmap

procedure SMART_DrawBitmap(Clear: Boolean; Bitmap: Integer; Placement: TPoint);

Draws a bitmap (Bitmap) on the SMART canvas at given coordinates (Placement). Will clear the canvas beforehand if specified to do so (Clear).

Note

Author: Coh3n Last Modified: January 10th, 2012 by Coh3n

Example:

SMART_DrawBitmap(true, bmp, point(5, 5));

SMART_FreeDebug

procedure SMART_FreeDebug();

Frees the SMART_Canvas bitmap.

Note

Author: Coh3n Last Modified: Unknown

Example:

SMART_FreeDebug();