onDeviceOrientationChange()
onDeviceOrientationChange: ({ GLctx, computeCtx, videoWidth, videoHeight, orientation })
説明
onDeviceOrientationChange()
は、デバイスの縦横の向きが変わったときに呼ばれる。
パラメータ
パラメータ | 説明 |
---|---|
GLctx | 描画キャンバスの WebGLRenderingContext または WebGL2RenderingContext . |
computeCtx | コンピュートキャンバスの WebGLRenderingContext または WebGL2RenderingContext . |
videoWidth | カメラフィードの幅(ピクセル単位)。 |
videoHeight | カメラフィードの高さ(ピクセル単位)。 |
orientation | ポートレートからのUIの回転を度単位で指定する(-90, 0, 90, 180)。 |
例
XR8.addCameraPipelineModule({
name: 'mycamerapipelinemodule',
onDeviceOrientationChange: ({ GLctx, videoWidth, videoHeight, orientation }) => {
// handleResize({ GLctx, videoWidth, videoHeight, orientation })
},
})