RSTranslator

This file is responsible for conversions or internal game values to values that can be used by Simba and back.


TTranslator

Record responsible for conversions or internal game values to values that can be used by Simba and back.


RSTranslator.MapWidth

property TTranslator.MapWidth: UInt32;

Returns the full width in pixels of the game map.

Example:

WriteLn RSTranslator.MapWidth;

RSTranslator.MapHeight

property TTranslator.MapHeight: Int32;

Returns the full height in pixels of the game map.

Example:

WriteLn RSTranslator.MapHeight;

RSTranslator.Global2Chunk

function TTranslator.Global2Chunk(pt: TPoint): TPoint;
function TTranslator.Global2Chunk(b: TBox): TBox; overload;

Converts a “Global” coordinate to a chunk number.

Example:

WriteLn RSTranslator.Global2Chunk(Point(2000, 2000));

RSTranslator.Chunk2Coordinate

function TTranslator.Chunk2Coordinate(p: TPoint): TPoint;
function TTranslator.Chunk2Coordinate(b: TBox): TBox; overload;

Converts a “Chunk” number to the top left “Global” coordinate of that chunk.

Example:

WriteLn RSTranslator.Chunk2Coordinate(Point(53, 50));

TTranslator.GetChunks

function TTranslator.GetChunks(lo, hi: TPoint): TPointArray; static;

Simple methods that will return all chunks in between a lo and hi chunks. This will also fix their order if required, as game chunks are oddly numbered from bottom to top on the Y axis.

Example:

WriteLn RSTranslator.GetChunks([20,20], [22,22]);
//This will return:
//[[20, 20], [20, 21], [20, 22], [21, 20], [21, 21], [21, 22], [22, 20], [22, 21], [22, 22]];

RSTranslator variable

Global TTranslator variable.