Skip to content

SpriteSheetLayout

Namespace Nfty.Core.Publish in assembly Nfty.Core.

public record SpriteSheetLayout

How a sheet is laid out: a grid of cells, in the Set's own canvas size.

Remarks

The cell is the CANVAS, never a size the caller picks. Every asset in a Set is the canvas size by construction — the CookBook fixes it and Validator checks every variant against it — so a cell that disagreed would mean either scaling the art or cropping it, and this project resamples nothing anywhere. A sheet is a stitch, not a render.

Constructors

SpriteSheetLayout(int, int, int, int)

public SpriteSheetLayout(int Columns, int Rows, int CellWidth, int CellHeight);

Parameters

  • Columns (int) - Cells across.
  • Rows (int) - Cells down.
  • CellWidth (int) - One cell's width — the Set's canvas width.
  • CellHeight (int) - One cell's height — the Set's canvas height.

Remarks

The cell is the CANVAS, never a size the caller picks. Every asset in a Set is the canvas size by construction — the CookBook fixes it and Validator checks every variant against it — so a cell that disagreed would mean either scaling the art or cropping it, and this project resamples nothing anywhere. A sheet is a stitch, not a render.

Properties

Capacity

public long Capacity { get; }

How many assets the grid holds.

CellHeight

public int CellHeight { get; init; }

One cell's height — the Set's canvas height.

CellWidth

public int CellWidth { get; init; }

One cell's width — the Set's canvas width.

Columns

public int Columns { get; init; }

Cells across.

Height

public long Height { get; }

The finished sheet's height in pixels.

Pixels

public long Pixels { get; }

The sheet's pixel count, which is what the size limit is actually about.

Rows

public int Rows { get; init; }

Cells down.

Width

public long Width { get; }

The finished sheet's width in pixels.

Methods

SizeText()

public string SizeText();

The dimensions as a person reads them: 2048 x 2048.

Returns. The size as text, invariant like every other figure this product prints.