textmode.js / TextmodeGrid
Class: TextmodeGrid
Manages the grid of each TextmodeLayer instance.
Accessors
cellHeight
Get Signature
get cellHeight(): number;Returns the height of each cell in the grid.
Returns
number
cellWidth
Get Signature
get cellWidth(): number;Returns the width of each cell in the grid.
Returns
number
cols
Get Signature
get cols(): number;Returns the number of columns in the grid.
Returns
number
Set Signature
set cols(newCols): void;Sets the number of columns and locks grid sizing until responsive() is called.
Parameters
| Parameter | Type |
|---|---|
newCols | number |
Returns
void
height
Get Signature
get height(): number;Returns the total height of the grid.
Returns
number
offsetX
Get Signature
get offsetX(): number;Returns the offset to the outer canvas borders on the x-axis when centering the grid.
Returns
number
offsetY
Get Signature
get offsetY(): number;Returns the offset to the outer canvas borders on the y-axis when centering the grid.
Returns
number
rows
Get Signature
get rows(): number;Returns the number of rows in the grid.
Returns
number
Set Signature
set rows(newRows): void;Sets the number of rows and locks grid sizing until responsive() is called.
Parameters
| Parameter | Type |
|---|---|
newRows | number |
Returns
void
width
Get Signature
get width(): number;Returns the total width of the grid.
Returns
number
Methods
responsive()
responsive(): void;Restores responsive sizing so subsequent t.resizeCanvas calls recompute cols/rows.
Returns
void