# 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 ```pascal property TRSTranslator.MapWidth: UInteger; ``` Returns the full width in pixels of the OldSchool RuneScape map. Example: ```pascal WriteLn RSTranslator.MapWidth; ``` - - - ## RSTranslator.MapHeight ```pascal property TRSTranslator.MapHeight: Integer; ``` Returns the full height in pixels of the OldSchool RuneScape map. Example: ```pascal WriteLn RSTranslator.MapHeight; ``` - - - ## RSTranslator.Global2Chunk ```pascal function TRSTranslator.Global2Chunk(p: TPoint): TPoint; function TRSTranslator.Global2Chunk(b: TBox): TBox; overload; ``` Converts a "Global" coordinate to a chunk number. Example: ```pascal WriteLn RSTranslator.Global2Chunk(Point(2000, 2000)); ``` - - - ## RSTranslator.Chunk2Coordinate ```pascal 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: ```pascal WriteLn RSTranslator.Chunk2Coordinate(Point(53, 50)); ``` - - - ## TRSTranslator.GetChunks ```pascal 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: ```pascal 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 {ref}`TRSTranslator` variable.