-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
57 lines (53 loc) · 1.46 KB
/
App.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";
import { ViroARSceneNavigator } from "react-viro";
import ARScene from "./js/ARScene";
import Joystick from './js/components/Joystick';
import { LocalCoordinatesProvider } from './js/Context/LocalCoordinatesContext';
import { ControlContextProvider } from './js/Context/ControlContext';
import { MasterContextProvider } from './js/Context/MasterContext';
class AiRPong extends Component {
render() {
return (
<>
<MasterContextProvider>
<ControlContextProvider>
<View style={styles.arscene}>
<LocalCoordinatesProvider>
<ViroARSceneNavigator
initialScene={{scene: ARScene}}
autofocus
hdrEnabled
/>
</LocalCoordinatesProvider>
</View>
<View style={styles.touchpadArea}>
<Joystick />
</View>
</ControlContextProvider>
</MasterContextProvider>
</>
)
}
}
const styles = StyleSheet.create({
arscene: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0
},
touchpadArea: {
alignSelf: 'center',
position: 'absolute',
width: 200,
height: 200,
backgroundColor: 'rgba(255,255,255,0.1)',
bottom: '15%',
borderRadius: 100,
borderColor: "rgba(255,255,255,0.5)",
borderWidth: 1
},
});
export default AiRPong;