Skip to content

Canvas

Each eye displays a 576 x 288 pixel canvas. Coordinate origin is at the top-left corner. X increases rightward, Y increases downward.

All colors are rendered as 4-bit greyscale — 16 levels of green. White pixels appear as bright green; black pixels are off (transparent).

Containers

The UI is built from containers — rectangular regions positioned with absolute pixel coordinates. There is no CSS, no flexbox, no DOM.

Rules:

  • Maximum 4 image containers and 8 other containers per page (mixed types allowed)
  • Exactly one container must have isEventCapture: 1 — this container receives all input events
  • Containers can overlap; later containers draw on top
  • No z-index control beyond declaration order

Shared Properties

PropertyTypeRangeNotes
xPositionnumber0–576Left edge (px)
yPositionnumber0–288Top edge (px)
widthnumber0–576Container width (px)
heightnumber0–288Container height (px)
containerIDnumberUnique per page
containerNamestringmax 16 charsUnique per page
isEventCapturenumber0 or 1Exactly one must be 1

Border Properties

Available on text and list containers only:

PropertyTypeRangeNotes
borderWidthnumber0–50 = no border
borderColornumber0–15 / 0–16Greyscale level
borderRdaiusnumber0–10Rounded corners (note: typo preserved from SDK protobuf)
paddingLengthnumber0–32Uniform padding on all sides

There is no background color or fill color property. The only visual decoration is the border.

Text Containers

The primary container type. Renders plain text, left-aligned, top-aligned. No text alignment options, no font size control, no bold/italic.

typescript
new TextContainerProperty({
  xPosition: 0,
  yPosition: 0,
  width: 576,
  height: 288,
  borderWidth: 0,
  borderColor: 5,
  paddingLength: 4,
  containerID: 1,
  containerName: 'main',
  content: 'Your text here',
  isEventCapture: 1,
})

Content Limits

MethodMax Characters
createStartUpPageContainer1,000
textContainerUpgrade2,000
rebuildPageContainer1,000

Behavior

  • Text wraps at container width
  • If content overflows and the container has isEventCapture: 1, the firmware handles internal scrolling
  • \n works for line breaks
  • Unicode characters are supported (within the firmware's font set)
  • ~400–500 characters fill a full-screen text container
  • To "center" text, manually pad with spaces

In-Place Updates

Use textContainerUpgrade — faster than a full page rebuild and flicker-free on hardware:

typescript
await bridge.textContainerUpgrade(containerID, containerName, newContent, contentOffset, contentLength)

List Containers

Native scrollable lists. The firmware handles scroll highlighting natively.

  • Maximum 20 items per list
  • Maximum 64 characters per item
  • No custom styling per item, no item height control, no separator lines
  • Cannot be updated in-place — must rebuild the entire page

Image Containers

Display greyscale images on the glasses.

  • Width: 20–200 px, Height: 20–100 px
  • 4-bit greyscale
  • Accepts number[], Uint8Array, ArrayBuffer, or base64
  • Cannot send during createStartUpPageContainer — create a placeholder container, then update via updateImageRawData
  • No concurrent image sends

Image-based app pattern: Use a full-screen text container (content: ' ') with isEventCapture: 1 behind the image container. The text container receives events; the image container draws on top.

Font & Unicode Support

The glasses use a single LVGL font baked into firmware. No font selection, no font size control, not monospaced. Characters outside the font are silently skipped.

Useful Characters for Building UIs

Use CaseCharacters
Progress bars █▇▆▅▄▃▂▁
Navigation▲△▶▷▼▽◀◁
Selection●○ ■□ ★☆
Borders╭╮╯╰ │─ box drawing set
Card suits♠♣♥♦

Full supported glyph tables are available in the community G2 notes.