Mad Level Manager
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
MadLevelManager.MadTexturePacker Class Reference

Public Types

enum  FreeRectChoiceHeuristic {
  FreeRectChoiceHeuristic.RectBestShortSideFit, FreeRectChoiceHeuristic.RectBestLongSideFit, FreeRectChoiceHeuristic.RectBestAreaFit, FreeRectChoiceHeuristic.RectBottomLeftRule,
  FreeRectChoiceHeuristic.RectContactPointRule
}
 

Public Member Functions

 MadTexturePacker (int width, int height, bool rotations)
 
void Init (int width, int height, bool rotations)
 
Rect Insert (int width, int height, FreeRectChoiceHeuristic method)
 
void Insert (List< Rect > rects, List< Rect > dst, FreeRectChoiceHeuristic method)
 
float Occupancy ()
 Computes the ratio of used surface area.
 

Static Public Member Functions

static Rect[] PackTextures (Texture2D texture, Texture2D[] textures, int width, int height, int padding, int maxSize)
 

Public Attributes

int binWidth = 0
 
int binHeight = 0
 
bool allowRotations
 
List< Rect > usedRectangles = new List<Rect>()
 
List< Rect > freeRectangles = new List<Rect>()
 

Member Enumeration Documentation

Enumerator
RectBestShortSideFit 

-BSSF: Positions the rectangle against the short side of a free rectangle into which it fits the best.

RectBestLongSideFit 

-BLSF: Positions the rectangle against the long side of a free rectangle into which it fits the best.

RectBestAreaFit 

-BAF: Positions the rectangle into the smallest free rect into which it fits.

RectBottomLeftRule 

-BL: Does the Tetris placement.

RectContactPointRule 

-CP: Choosest the placement where the rectangle touches other rects as much as possible.


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