RSTranslator¶
This file is responsible for conversions or internal RuneScape values to values that can be used by Simba and back.
TRSTranslator¶
Record responsible for conversions or internal RuneScape values to values that can be used by Simba and back.
RSTranslator.MapWidth¶
property TRSTranslator.MapWidth: UInteger;
Returns the full width in pixels of the OldSchool RuneScape map.
Example:
WriteLn RSTranslator.MapWidth;
RSTranslator.MapHeight¶
property TRSTranslator.MapHeight: Integer;
Returns the full height in pixels of the OldSchool RuneScape map.
Example:
WriteLn RSTranslator.MapHeight;
RSTranslator.Global2Chunk¶
function TRSTranslator.Global2Chunk(p: TPoint): TPoint;
function TRSTranslator.Global2Chunk(b: TBox): TBox; overload;
Converts a “Global” coordinate to a chunk number.
Example:
WriteLn RSTranslator.Global2Chunk(Point(2000, 2000));
RSTranslator.Chunk2Coordinate¶
function TRSTranslator.Chunk2Coordinate(p: TPoint): TPoint;
function TRSTranslator.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));
TRSTranslator.GetChunks¶
function TRSTranslator.GetChunks(start, finish: TPoint): TPointArray; static;
Simple methods that will return all chunks in between a start
and finish
chunks.
This will also fix their order if required, as osrs 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 TRSTranslator variable.