RexReader
 All Classes Namespaces Functions Properties
RexTools.RexReader Class Reference

Reads a compressed .xp stream and provides methods to read the data. More...

Inheritance diagram for RexTools.RexReader:

Public Member Functions

 RexReader (Stream inputStream)
 Construct a RexReader from a compressed stream (of the .xp format) More...
 
 RexReader (string filePath)
 Construct a RexReader from an .xp file. Throws standard errors if the file doesn't exist. More...
 
int GetLayerCount ()
 Retrieve the number of layers in the source file More...
 
int GetLayerWidth (int layer)
 Gets the width of the layer specified More...
 
int GetLayerHeight (int layer)
 Gets the height of the layer specified. Throws More...
 
string ReadLayerAsString (int layer)
 Reads the characters of the specified layer into a string and returns it. No newlines/colors are included. Returned string goes down, then right (down each column and wraps up to the top on a new column) ie column-major. More...
 
TileMap GetMap ()
 Retrieves the entire map, including all its layers. Row-major order for tiles (y, then x). More...
 
void Dispose ()
 

Detailed Description

Reads a compressed .xp stream and provides methods to read the data.

Constructor & Destructor Documentation

RexTools.RexReader.RexReader ( Stream  inputStream)

Construct a RexReader from a compressed stream (of the .xp format)

Parameters
inputStreamThe compressed stream of the .xp file
RexTools.RexReader.RexReader ( string  filePath)

Construct a RexReader from an .xp file. Throws standard errors if the file doesn't exist.

Parameters
filePathPath to the .xp file

Member Function Documentation

int RexTools.RexReader.GetLayerCount ( )

Retrieve the number of layers in the source file

Returns
Number of layers in image
int RexTools.RexReader.GetLayerHeight ( int  layer)

Gets the height of the layer specified. Throws

Parameters
layerThe 0-based layer number
Returns
The height in cells of the specified layer
int RexTools.RexReader.GetLayerWidth ( int  layer)

Gets the width of the layer specified

Parameters
layerThe 0-based layer number
Returns
The width in cells of the specified layer
TileMap RexTools.RexReader.GetMap ( )

Retrieves the entire map, including all its layers. Row-major order for tiles (y, then x).

Returns
The corresponding TileMap that is contained in the .xp file

Note that (255,0,255) looks to be the 'transparent' code. But only for backgrounds? If you see magenta where you thought was black, that's why.

string RexTools.RexReader.ReadLayerAsString ( int  layer)

Reads the characters of the specified layer into a string and returns it. No newlines/colors are included. Returned string goes down, then right (down each column and wraps up to the top on a new column) ie column-major.

Parameters
layer
Returns

The documentation for this class was generated from the following file: