API reference
API reference
Select your platform
No SDKs available
No versions available

PanelRegistration

PanelRegistration

open class PanelRegistration(val registrationId: Int, val init: PanelRegistration.(entity: Entity) -> Unit)
PanelRegistration is a class that allows you to register a panel with the Spatial Toolkit. To use panels in your app, you will need to:
  1. Register the panel definition
  2. Spawn the panel in the 3D scene
Details on how to use this class can be found in the Spatial Toolkit documentation: https://developers.meta.com/horizon/documentation/spatial-sdk/spatial-sdk-2dpanel-registration
Parameters
JVM
NameSummary
registrationId
The unique identifier for this panel
init
The initialization block that will be called when the panel is created
See also

Constructors

NameSummary
PanelRegistration
constructor(registrationId: Int, init: PanelRegistration.(entity: Entity) -> Unit)

Properties

NameSummary
activityClass
var activityClass: Class<*>?
Activity class if the panel is powered by an activity and its layout/logic.
init
val init: PanelRegistration.(entity: Entity) -> Unit
layoutResourceId
var layoutResourceId: Int?
Layout resource id if the panel is view-based and created in the same immersive activity.
panelIntent
var panelIntent: <Error class: unknown class>?
Intent to launch the panel’s activity if the panel is activity-based.
registrationId
val registrationId: Int

Functions

NameSummary
config
fun config(overriding: Boolean = true, block: PanelConfigOptions.() -> Unit): PanelRegistration
panel
fun panel(overriding: Boolean = true, block: PanelSceneObject.() -> Unit): PanelRegistration
panelComponent
fun panelComponent(): Panel
Returns the @see Panel component that will be used to create the panel entity.
panelCreator
open fun panelCreator(scene: Scene, spatialContext: SpatialContext): (entity: Entity) -> PanelSceneObject
Returns a function that takes an entity as input and returns a PanelSceneObject. This function will be used to create the panel scene object in @see PanelCreationSystem. Whenever you create Entity with Panel(registrationId) component, this function will be called to create the panel scene object.
view
fun view(block: (<Error class: unknown class>) -> <Error class: unknown class>): PanelRegistration
Did you find this page helpful?
Thumbs up icon
Thumbs down icon