Skip to main content

Pos

Type Alias Pos 

Source
pub type Pos = Pos<u16>;
Expand description

Pos in the grid, in (x = column, y = row) order.

Implements Ord in row-major order (y primary, then x), which is the natural ordering for terminal rendering: top-to-bottom, left-to-right within each row.

Aliased Type§

#[repr(C)]
pub struct Pos { pub x: u16, pub y: u16, }

Fields§

§x: u16

The x-coordinate, or horizontal position from the origin.

(x increases →)
+---------→ x
|
|
↓
y
§y: u16

The y-coordinate, or vertical position from the origin.

(y increases ↓)
+---------→ x
|
|
↓
y