# `NestGen2.Display`
[🔗](https://github.com/integration-technology/nest_gen2_sdk/blob/v0.6.6/lib/nest_gen2/display.ex#L1)

The 320×320 round screen, double-buffered.

Drawing calls update a back buffer; `present/0` shows everything drawn since
the last present in one page flip, so a partly drawn frame is never visible.

The visible area is the circle inscribed in the square: centre `{160, 160}`,
radius 160. Backgrounds can bleed to the edge; keep text and icons inside
`safe_radius/0`, since the bezel covers the outermost few pixels.

# `center`

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `fill_rect`

```elixir
@spec fill_rect(
  integer(),
  integer(),
  pos_integer(),
  pos_integer(),
  NestGen2.Image.color()
) :: :ok
```

# `height`

# `present`

```elixir
@spec present() :: :ok
```

Shows everything drawn since the last present, in one page flip.

# `put_image`

```elixir
@spec put_image(integer(), integer(), NestGen2.Image.t()) :: :ok
```

Draws an image with its top-left corner at (x, y).

# `put_text`

```elixir
@spec put_text(integer(), integer(), String.t(), keyword()) :: :ok | {:error, term()}
```

Draws text with its top edge at `y`. Takes `NestGen2.Text` options plus
`:align` — `:left` (x is the left edge, default), `:center` or `:right`.

# `radius`

# `safe_radius`

# `set_background`

```elixir
@spec set_background(NestGen2.Image.t() | NestGen2.Image.color()) :: :ok
```

Replaces the whole screen with a 320×320 image or a solid colour, given as a
hex string or `{r, g, b}` tuple:

    NestGen2.Display.set_background("#1C1C1E")

A colour fills the visible circle (radius 160) and leaves the corners black,
as Nest's own screens do, so no coloured slivers show where the bezel's
cut-out meets the square panel. Images are drawn as given; make their
corners black for the same reason.

# `snapshot`

```elixir
@spec snapshot() :: NestGen2.Image.t()
```

What the screen shows: the frame as of the last `present/0`, as a 320×320
image. `NestGen2.Image.to_png/1` turns it into a PNG.

# `start_link`

# `width`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
