-
Notifications
You must be signed in to change notification settings - Fork 10
/
client.js
29 lines (24 loc) · 903 Bytes
/
client.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// This file contains the boilerplate to execute your React app.
// If you want to modify your application's content, start in "index.js"
import {Math as VRMath, ReactInstance, Surface} from 'react-360-web';
import KeyboardModule from './react-360-keyboard/KeyboardModule';
import WebVRPolyfill from 'webvr-polyfill';
const polyfill = new WebVRPolyfill();
function init(bundle, parent, options = {}) {
const r360 = new ReactInstance(bundle, parent, {
// Add custom options here
fullScreen: true,
nativeModules: [KeyboardModule.addModule],
...options,
});
// Render your app content to the default cylinder surface
r360.renderToSurface(
r360.createRoot('Keyboard360', {
/* initial props */
}),
r360.getDefaultSurface(),
);
r360.compositor.setBackground(r360.getAssetURL('360_world.jpg'));
KeyboardModule.setInstance(r360);
}
window.React360 = {init};