# 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 ```pascal property TTranslator.MapWidth: UInt32; ``` Returns the full width in pixels of the game map. Example: ```pascal WriteLn RSTranslator.MapWidth; ``` - - - ## RSTranslator.MapHeight ```pascal property TTranslator.MapHeight: Int32; ``` Returns the full height in pixels of the game map. Example: ```pascal WriteLn RSTranslator.MapHeight; ``` - - - ## RSTranslator.Global2Chunk ```pascal function TTranslator.Global2Chunk(pt: TPoint): TPoint; function TTranslator.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 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: ```pascal WriteLn RSTranslator.Chunk2Coordinate(Point(53, 50)); ``` - - - ## TTranslator.GetChunks ```pascal 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: ```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}`TTranslator` variable.