C# Class Sphere.Core.Tileset

A sphree Tileset object.
Inheritance: IDisposable
显示文件 Open project: Radnen/spherestudio Class Usage Examples

Public Methods

Method Description
CreateNew ( short tileWidth, short tileHeight ) : void

Adds a blank tile to the list of tiles.

Dispose ( ) : void

Disposes and clears this Tileset.

FromBinary ( BinaryReader reader ) : Tileset

Loads a tileset from a filestream.

FromFile ( string filename ) : Tileset

Loads a tileset independantly from a file.

FromSpriteset ( Spriteset set ) : Tileset

Takes the images of a spriteset and creates a ileset representation of it.

ResizeTiles ( short tw, short th, bool rescale ) : void

Resizes the tiles in the tileset.

Save ( string filename ) : void

Savbes the tileset to a separate file.

SaveImage ( string filename, int across = 6 ) : void

Saves the tileset as an image.

Tileset ( ) : System

Creates a fresh, empty tileset.

UpdateFromImage ( string filename ) : void

Updates graphics From a tileset image file.

Private Methods

Method Description
Dispose ( bool disposing ) : void

Method Details

CreateNew() public method

Adds a blank tile to the list of tiles.
public CreateNew ( short tileWidth, short tileHeight ) : void
tileWidth short The tile width in pixels.
tileHeight short The tile height in pixels.
return void

Dispose() public method

Disposes and clears this Tileset.
public Dispose ( ) : void
return void

FromBinary() public static method

Loads a tileset from a filestream.
public static FromBinary ( BinaryReader reader ) : Tileset
reader System.IO.BinaryReader The System.IO.BinrayReader to use.
return Tileset

FromFile() public static method

Loads a tileset independantly from a file.
public static FromFile ( string filename ) : Tileset
filename string The filename to load from.
return Tileset

FromSpriteset() public static method

Takes the images of a spriteset and creates a ileset representation of it.
public static FromSpriteset ( Spriteset set ) : Tileset
set Spriteset The spriteset to use.
return Tileset

ResizeTiles() public method

Resizes the tiles in the tileset.
public ResizeTiles ( short tw, short th, bool rescale ) : void
tw short New tile width.
th short New tile height.
rescale bool If true rescale, else resize.
return void

Save() public method

Savbes the tileset to a separate file.
public Save ( string filename ) : void
filename string The filename to save to.
return void

SaveImage() public method

Saves the tileset as an image.
public SaveImage ( string filename, int across = 6 ) : void
filename string The filename to save to.
across int The amount of tiles to put across (width-wise).
return void

Tileset() public method

Creates a fresh, empty tileset.
public Tileset ( ) : System
return System

UpdateFromImage() public method

Updates graphics From a tileset image file.
public UpdateFromImage ( string filename ) : void
filename string
return void