React VR is a JavaScript framework used to create Virtual
Reality applications. Let's practice editing our code!
Visit Setting up React VR to set up.
This lesson was inspired by a workshop I attended: ReactVR - a VR Workshop with Javascript.
Thank you to Praveen Yalamanchi and Damian Montero.
In the example below, I change the background color to yellow. Change the text's background color to anything you like.
<Text style={{textAlign: "center", fontSize: 0.4, color: 'black',backgroundColor: 'yellow',}}>Beach Items: {this.props.text}</Text>
Delete the text "Beach Items". Your code should now look like the example below.
<Text style={{textAlign: "center", fontSize: 0.4, color: 'black',backgroundColor: 'yellow',}}>{this.props.text}</Text>
Create a new class called "Heading". Use props to have the heading say "Beach Items". Format the text however you like.
// Heading
class Heading extends Component {
render() {
return (
<Text style={{textAlign: "center", fontSize: 0.4, color: 'orange',backgroundColor: 'white',}}>{this.props.head}</Text>
)
}
};
See the example below.
export default class Basics extends Component {
render() {
return (
<View>
<Pano source={asset('water-view.jpeg')}></Pano>
<View>
style={{
transform: [{translate: [0, 0, -3]}],
layoutOrigin: [0.5, 0.5]
}}>
<Heading head='Beach Items' />
<Beach text='Towel' />
<Beach text='Sunscreen' />
<Beach text='Beverage' />
</View>
</View>
)
}
};
You should see something like this: