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

PanelConfigOptions

PanelConfigOptions

data class PanelConfigOptions(var layoutHeightInPx: Int = 0, var layoutWidthInPx: Int = 0, var layoutHeightInDp: Float = 0.0f, var layoutWidthInDp: Float = 0.0f, var layoutDpi: Int = DEFAULT_DPI, var height: Float = 1.0f * 3f / 4f, var width: Float = 1.0f, var radiusForCylinderOrSphere: Float = 1.0f, var pivotOffsetHeight: Float = 0.5f, var pivotOffsetWidth: Float = 0.5f, var fractionOfScreen: Float = 0.5f, var mips: Int = 4, var samplerConfig: SamplerConfig = DEFAULT_PANEL_SAMPLER, var unlit: Boolean = true, var includeGlass: Boolean = true, var stereoMode: StereoMode = StereoMode.None, var alphaMode: AlphaMode = AlphaMode.MASKED, var forceSceneTexture: Boolean = false, var clickButtons: Int = DEFAULT_CLICK_BUTTONS, var panelShader: String = "", var effectShader: String = "", var sceneMeshCreator: PanelShapeConfig.(texture: SceneTexture) -> SceneMesh? = null, var layerConfig: LayerConfig? = null, var panelShapeType: PanelShapeType = PanelShapeType.QUAD, var enableTransparent: Boolean = false, var enableLayer: Boolean = false, var themeResourceId: Int = 0) : PanelShapeConfig
Configuration options for the panel. This is used to configure the panel’s size, shape, resolution, mesh creator, and other properties. This is used to create the panel’s SceneObject.
See also
 
PanelRegistration

Constructors

NameSummary
PanelConfigOptions
constructor(layoutHeightInPx: Int = 0, layoutWidthInPx: Int = 0, layoutHeightInDp: Float = 0.0f, layoutWidthInDp: Float = 0.0f, layoutDpi: Int = DEFAULT_DPI, height: Float = 1.0f * 3f / 4f, width: Float = 1.0f, radiusForCylinderOrSphere: Float = 1.0f, pivotOffsetHeight: Float = 0.5f, pivotOffsetWidth: Float = 0.5f, fractionOfScreen: Float = 0.5f, mips: Int = 4, samplerConfig: SamplerConfig = DEFAULT_PANEL_SAMPLER, unlit: Boolean = true, includeGlass: Boolean = true, stereoMode: StereoMode = StereoMode.None, alphaMode: AlphaMode = AlphaMode.MASKED, forceSceneTexture: Boolean = false, clickButtons: Int = DEFAULT_CLICK_BUTTONS, panelShader: String = "", effectShader: String = "", sceneMeshCreator: PanelShapeConfig.(texture: SceneTexture) -> SceneMesh? = null, layerConfig: LayerConfig? = null, panelShapeType: PanelShapeType = PanelShapeType.QUAD, enableTransparent: Boolean = false, enableLayer: Boolean = false, themeResourceId: Int = 0)

Types

NameSummary
Companion
object Companion

Properties

NameSummary
alphaMode
open override var alphaMode: AlphaMode
the alpha mode to use for the panel
clickButtons
var clickButtons: Int
Buttons mask that we use to determine if we should simulate a click on the panel
effectShader
var effectShader: String
Optional path to a custom shader to use in the effect chain
enableLayer
open override var enableLayer: Boolean
if true, the panel will have a layer created for it
enableTransparent
open override var enableTransparent: Boolean
if true, the panel will be rendered as transparent
forceSceneTexture
open override var forceSceneTexture: Boolean
If true, we populate a SceneTexture while using Layers. This will incur extra runtime cost for the copies required, but can be useful for hole punching and creating masks
fractionOfScreen
open override var fractionOfScreen: Float
The fraction of the screen that the panel should take up
height
open override var height: Float
The height of the panel in meters, used to calculate the size of the panel in the scene
includeGlass
open override var includeGlass: Boolean
If true, the panel will have glass effect rendered in the scene
layerConfig
open override var layerConfig: LayerConfig?
optional configuration for the panel’s layer
layoutDpi
var layoutDpi: Int
The dpi of the panel, used in creating Android virtual display
layoutHeightInDp
var layoutHeightInDp: Float
The width of the panel in dp.
layoutHeightInPx
var layoutHeightInPx: Int
The width of the panel in pixels, can be derived from layoutHeightInDp and layoutDpi if not setting. It will be used to create Android virtual display.
layoutWidthInDp
var layoutWidthInDp: Float
The height of the panel in dp.
layoutWidthInPx
var layoutWidthInPx: Int
The height of the panel in pixels, can be derived from layoutWidthInDp and layoutDpi if not setting. It will be used to create Android virtual display.
mips
var mips: Int
If mips is < 0, then maximum number of mip levels will be used
panelShader
open override var panelShader: String
Optional path to a custom shader to use for the panel. SceneMaterial.Companion has default bundled shaders that can be used.
panelShapeType
open override var panelShapeType: PanelShapeType
the shape of the panel, can be quad, cylinder, or sphere
pivotOffsetHeight
open override var pivotOffsetHeight: Float
The offset of the panel in meters, used to calculate the pivote point when rotating and moving as grabbing
pivotOffsetWidth
open override var pivotOffsetWidth: Float
The offset of the panel in meters, used to calculate the pivote point when rotating and moving as grabbing
radiusForCylinderOrSphere
open override var radiusForCylinderOrSphere: Float
The radius of the panel in meters if the panel is cylidner or sphere shape
samplerConfig
var samplerConfig: SamplerConfig
Sampler config to set the panel texture/layer
sceneMeshCreator
open override var sceneMeshCreator: PanelShapeConfig.(texture: SceneTexture) -> SceneMesh?
optional function to create a custom mesh for the panel
stereoMode
open override var stereoMode: StereoMode
the stereo mode to use for the panel
themeResourceId
var themeResourceId: Int
the theme resource id to use for the panel
unlit
open override var unlit: Boolean
if true, the panel will be rendered as unlit
width
open override var width: Float
The width of the panel in meters, used to calculate the size of the panel in the scene

Functions

NameSummary
calcDPI
fun calcDPI(): Int
Get the current dpi setting.
calcLayoutHeightInPx
fun calcLayoutHeightInPx(): Int
Calculates the height of the panel in pixels based on the current configuration. This is used to creating the Android Virtual Display with the specified height in pixels.
calcLayoutWidthInPx
fun calcLayoutWidthInPx(): Int
Calculates the width of the panel in pixels based on the current configuration. This is used to creating the Android Virtual Display with the specified width in pixels.
dpToPx
fun dpToPx(dp: Float): Int
Converts dp to px based on the current dpi setting.
generateSceneMeshCreator
fun generateSceneMeshCreator(): PanelShapeConfig.(texture: SceneTexture) -> SceneMesh
init
fun init()

Companion

object Companion

Properties

NameSummary
DEFAULT_CLICK_BUTTONS
val DEFAULT_CLICK_BUTTONS: Int
DEFAULT_DPI
const val DEFAULT_DPI: Int
DEFAULT_PANEL_SAMPLER
val DEFAULT_PANEL_SAMPLER: SamplerConfig
DEVICE_DPI
val DEVICE_DPI: Int
DEVICE_PPD
val DEVICE_PPD: <Error class: unknown class>
EYEBUFFER_HEIGHT
const val EYEBUFFER_HEIGHT: Int = 2208
EYEBUFFER_WIDTH
const val EYEBUFFER_WIDTH: Int = 2064
MIPS_MAX
const val MIPS_MAX: Int
Did you find this page helpful?
Thumbs up icon
Thumbs down icon