-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
86 lines (74 loc) · 1.69 KB
/
index.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import React from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Image,
asset,
Environment,
VrButton,
console,
} from 'react-360';
Environment.setBackgroundImage(asset('Renascent2.jpg'), {
format: '3DTB',
});
export default class Gallery360 extends React.Component {
constructor() {
super();
this.state = {
count: 0,
};
this.pictureArray = ['360_world.jpg', 'RedRockBridge.jpg', 'Renascent2.jpg', 'Renascent3.jpg'];
}
changeImage() {
this.setState({count: (this.state.count + 1) % this.pictureArray.length});
return (
//I need a way to tell the DOM to update here
Environment.setBackgroundImage(asset(this.pictureArray[this.state.count]), {
format: '3DTB',
})
);
}
render() {
return (
<View id="theView" style={styles.panel}>
<VrButton onClick={() => this.changeImage()} style={styles.panel}>
<Image source={asset('renascent-inc-experts-in-demolition.jpg')} style={styles.panel}/>
</VrButton>
</View>
);
}
};
const styles = StyleSheet.create({
panel: {
// Fill the entire surface
width: 1000,
height: 600,
backgroundColor: 'rgba(255, 255, 255, 0.4)',
justifyContent: 'center',
alignItems: 'center',
},
greetingBox: {
padding: 20,
backgroundColor: '#000000',
borderColor: '#639dda',
borderWidth: 2,
},
greeting: {
fontSize: 30,
},
button: {
backgroundColor: '#c0c0d0',
borderRadius: 5,
width: 40,
height: 44,
},
buttonText: {
textAlign: 'center',
color: '#000000',
fontSize: 30,
fontWeight: 'bold',
},
});
AppRegistry.registerComponent('Gallery360', () => Gallery360);