-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
53 lines (45 loc) · 1.18 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
import React, {Component} from 'react';
import {Platform, View, NativeModules, Dimensions, Text} from 'react-native';
import { Container } from 'native-base';
import ArucoIOS from './ArucoView';
export default class App extends Component {
componentWillMount(){
// Aruco.emitter.addListener('CAMERA_FRAME_EVENT', ({markers})=>{
// this.setState(()=>({markerList: markers}))
// });
// ArucoModule.setRNScreenDimensions(
// Dimensions.get("window").width,
// Dimensions.get("window").height
// );
}
render() {
return (
<Container>
<ArucoIOS
style={{flex: 1}}
onArucoDetect={ (result) => {
}}
/>
</Container>
);
}
identifyMarkers = function(){
return this.state.markerList.map(marker=>{
return(
// <View style={this.positionStyle(marker)}>
<Text style={this.positionStyle(marker)}>
{"[" + marker.rnx + ", " + marker.rny + "]"}
</Text>
// </View>
)
})
}
positionStyle = function(marker){
return {
position: 'absolute',
top: marker.rny,
left: marker.rnx,
alignItems: 'center',
}
}
}