public bool Pack() { while (!TryPack()) { if (height == width) { width *= 2; } else { height *= 2; } tree = new Space(0, 0, width, height); } return true; }
public bool Pack(int _width, int _height) { width = _width; height = _height; tree = new Space(0, 0, width, height); return TryPack(); }
public SpritePacker(IEnumerable<Sprite> sprites) { GetSpriteSheetSize(sprites); tree = new Space(0, 0, width, height); this.sprites = sprites.OrderByDescending(sprite => sprite.Area).ToList(); }