Skip to content

UI Kit

Overview

The Maverick AI UI Kit provides drawables, screens, controls, and animation APIs for on-board rendering on the glasses.

Core Building Blocks

HUD Drawables

Category Classes
Screens M2Screen, M2FullScreen, M2ScreenSaver, M2PersonalAdjustScreen
Shapes M2RectFilled, M2RectOutline, M2EllipseFilled, M2EllipseOutline, M2EllipseFrame, M2Arc, M2Line, M2Segment, M2Path
Text M2Text, M2TextTicker, M2TextPanel
Media M2Image, M2Texture, M2SpriteImage
Geometry M2Triangles, M2Strip, M2Fan
Containers M2Panel
Controls M2Spinner, M2Loading, M2ListeningView, M2ListeningViewControl, M2GazeIndicator

AR (Line of Sight) Drawables

Category Classes
Screen M2ArScreen
Containers M2ArPanel, M2ArScene
3D Geometry M2ArMesh, M2ArLines, M2ArPoints, M2ArLight
Controls M2ArSpinner

Additional classes planned

Some classes listed in the API reference (e.g. M2Clip, M2ClipResource) are not available in the current alpha release. See the Roadmap for planned features.

Quick Start - Hello World

class HelloScreen :  M2Screen(540f, 280f) {

    override fun onCreate() {
        val title = M2Text()
        title.setFont(M2FontResource.fontMedium)
            .setText("Hello Maverick AI!")
            .setAlign(Align.CenterHorizontal)
            .setX(320f).setY(180f)
            .setColor(M2Color.White)
        add(title)
    }
}

// Push the screen onto the stack
Evs.screenService.addScreen(HelloScreen())

Typical Flow

  1. Create a screen subclass (M2FullScreen or M2ArScreen)
  2. Override onCreate() to build your drawable tree
  3. Push the screen with Evs.screenService.addScreen(screen)
  4. Update drawable properties according to app events (e.g. touch, internal logic)
  5. You may also override onBeforeDraw(timestamp) to update time-based properties
  6. Use animators for smooth property transitions
  7. The SDK sends only changed properties to the glasses each tick

Display Constants

  • Resolution: 640 x 400 pixels
  • Color depth: 16-bit
  • Refresh rate: ~67 Hz (on-device)

See Also