C# Class TexturePacker.Packer

Objects that performs the packing task. Takes a list of textures as input and generates a set of atlas textures/definition pairs
ファイルを表示 Open project: mfascia/TexturePacker Class Usage Examples

Public Properties

Property Type Description
AtlasSize int
Atlasses List
DebugMode bool
Error System.IO.StringWriter
FitHeuristic BestFitHeuristic
Log System.IO.StringWriter
Padding int
SourceTextures List

Public Methods

Method Description
Packer ( ) : System
Process ( string _SourceDir, string _Pattern, int _AtlasSize, int _Padding, bool _DebugMode ) : void
SaveAtlasses ( string _Destination ) : void

Private Methods

Method Description
CreateAtlasImage ( Atlas _Atlas ) : Image
FindBestFitForNode ( Node _Node, List _Textures ) : TextureInfo
HorizontalSplit ( Node _ToSplit, int _Width, int _Height, List _List ) : void
LayoutAtlas ( List _Textures, Atlas _Atlas ) : List
ScanForTextures ( string _Path, string _Wildcard ) : void
VerticalSplit ( Node _ToSplit, int _Width, int _Height, List _List ) : void

Method Details

Packer() public method

public Packer ( ) : System
return System

Process() public method

public Process ( string _SourceDir, string _Pattern, int _AtlasSize, int _Padding, bool _DebugMode ) : void
_SourceDir string
_Pattern string
_AtlasSize int
_Padding int
_DebugMode bool
return void

SaveAtlasses() public method

public SaveAtlasses ( string _Destination ) : void
_Destination string
return void

Property Details

AtlasSize public_oe property

Size of the atlas in pixels. Represents one axis, as atlases are square
public int AtlasSize
return int

Atlasses public_oe property

List of all the output atlases
public List Atlasses
return List

DebugMode public_oe property

Toggle for debug mode, resulting in debug atlasses to check the packing algorithm
public bool DebugMode
return bool

Error public_oe property

Stream that recieves all the error info
public StringWriter,System.IO Error
return System.IO.StringWriter

FitHeuristic public_oe property

Which heuristic to use when doing the fit
public BestFitHeuristic FitHeuristic
return BestFitHeuristic

Log public_oe property

Stream that recieves all the info logged
public StringWriter,System.IO Log
return System.IO.StringWriter

Padding public_oe property

Number of pixels that separate textures in the atlas
public int Padding
return int

SourceTextures public_oe property

List of all the textures that need to be packed
public List SourceTextures
return List