Develop

2D panels in Spatial SDK

Updated: Nov 20, 2026

Overview

Spatial SDK lets you use any Android UI framework to create 2D UIs, then create a panel for them in your 3D scene. Spatial SDK handles rendering and input handling, allowing you to focus on creating UIs.
Here is an example of panels in the video player sample app:
2D panels in Spatial SDK
New developers should explore design guidelines. These guidelines ensure your application is immersive and accessible.

Understanding panels

Think of panels as Android UIs that exist as objects in your scene. A panel displays your Android UI like a physical computer monitor displays your desktop. Instead of sitting on a desk, it can float in mid-air, attach to walls, or move around to follow a user.
Panels solve a fundamental challenge: bringing familiar Android UI development into immersive 3D experiences. Instead of rebuilding everything from scratch in 3D, panels let you:
  • Leverage existing skills: Use the Android development knowledge you already have
  • Maintain familiar interactions: Buttons, lists, and forms work as users expect
  • Present complex information: Text, images, and structured data display better on flat surfaces than in 3D space
  • Integrate seamlessly: Your 2D interfaces become natural parts of the 3D world

Scene panels and hybrid app windows

A panel in this guide is a surface inside your app’s own 3D scene. Your app registers it, spawns it, and sets its placement, size, and rendering.
Horizon OS also runs 2D panel activities for hybrid apps. Your app declares that 2D surface as an Android activity rather than registering it as a scene panel. The registration, resolution, and rendering settings on this page configure panels in your app’s scene, not that activity’s OS-managed surface.

The blueprint and instance model

Panels follow a two-phase lifecycle that separates what they are from where they appear:
Registration creates the blueprint for a panel. It defines the panel’s look, behavior, and content. Register a panel once and use it multiple times.
Spawning creates instances of a registered panel in your 3D scene. Each instance has its own position and properties.
This separation lets you have multiple copies of the same panel type, like multiple video players. You can also create and destroy panels at runtime without redefining their core behavior.
Once spawned, panels become objects with spatial properties:
  • Position: They exist at specific coordinates in your 3D world
  • Orientation: They can face different directions or be angled for optimal viewing
  • Scale: They can be resized while maintaining their aspect ratio and functionality
  • Physics: They can respond to physics interactions, be grabbed, or moved around
  • Depth: With the panel settings APIs, the default masked mode and opaque mode write depth, so panels occlude other 3D objects. Alpha blend mode does not write depth, so a panel using it can draw in the wrong order. See Layer blending modes.
The Spatial SDK projects your 2D Android UI onto 3D surfaces and handles input. When users touch or point at your panel, the SDK translates 3D interactions into Android touch events.

Why use 2D panels

Integrating 2D panels into 3D scenes provides several benefits:
  • Present information with precision: 2D panels excel at displaying text, images, and UI components. This can be challenging with purely 3D elements.
  • Familiar user interface: Panels offer a familiar interface, making navigation and interaction more intuitive in a 3D space.
  • Performance: 2D elements are generally less resource-intensive than 3D objects. This helps maintain better performance in your applications.

Development mindset

Differences

  • Traditional Android: “How does this look on different screen sizes?”
  • Spatial: “How does this look at different distances and viewing angles?”

Your Android skills still apply

// This familiar Android code works the same in panels:
val button = findViewById<Button>(R.id.my_button)
button.setOnClickListener {
    Toast.makeText(this, "Clicked in 3D space!", Toast.LENGTH_SHORT).show()
}

3D placement

// This is the new part - positioning your UI in 3D space:
Entity.createPanelEntity(
    R.id.my_panel,
    Transform(Pose(Vector3(0f, 1.5f, -2f))), // 2m forward, 1.5m up
)
The SDK handles the complex work of making your 2D Android UI appear as a 3D object.

Implementation

  1. Register your panel: Create the blueprint for your panel
  2. Spawn your panel: Add the panel to your 3D scene
  3. Panels in Spatial Editor: Use the Spatial Editor to create and manage panels

Configuration guides

Once you have basic panels working, explore these advanced topics:

Design guidelines