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, M2PersonalAdjustScreen |
| Shapes |
M2RectFilled, M2RectOutline, M2EllipseFilled, M2EllipseOutline, M2EllipseFrame, M2Arc, M2Line, M2Segment, M2Path |
| Text |
M2Text, M2TextTicker, M2TextPanel, M2TextMarquee |
| Media |
M2Image, M2Texture, M2SpriteImage, M2VideoClip |
| Geometry |
M2Triangles, M2Strip, M2Fan |
| Containers |
M2Panel |
| Controls |
M2Spinner, M2Loading, M2ListeningView, M2ListeningViewControl |
AR (Line of Sight) Drawables
| Category |
Classes |
| Screen |
M2ArScreen |
| Containers |
M2ArPanel, M2ArScene |
| 3D Geometry |
M2ArMesh, M2ArLines, M2ArPoints, M2ArLight |
| Controls |
M2ArSpinner |
Quick Start - Hello World
class HelloScreen : M2Screen(width = 540f, height = 280f) {
override fun onCreate() {
super.onCreate()
val title = M2Text("title").apply {
setFont(M2FontResource.fontMedium)
setText("Hello Maverick AI!")
setAlign(M2Align.CenterBoth)
setColor(M2Color.White)
setXY(width / 2f, height / 2f)
}
add(title)
}
}
// Push the screen onto the stack
Evs.screenService.addScreen(HelloScreen())
Typical Flow
- Create a screen subclass (
M2FullScreen or M2ArScreen)
- Override
onCreate() to build your drawable tree
- Push the screen with
Evs.screenService.addScreen(screen)
- Update drawable properties according to app events (e.g. touch, internal logic)
- You may also override
onBeforeDraw(timestamp) to update time-based properties
- Use animators for smooth property transitions
- 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