April 2020
Intermediate to advanced
716 pages
18h 55m
English
In order to set the game's 360-degree world background, we will update the current background scene using the setBackgroundImage method from the Environment API. We will call this inside the componentDidMount of the MERNVR component defined in index.js, as shown in the following code:
/MERNVR/index.js
componentDidMount = () => { Environment.setBackgroundImage( {uri: this.state.game.world} )}
This will replace the default 360-degree background in the starter React 360 project with our sample game's world image fetched from cloud storage. If you are editing the default React 360 application and have it running, refreshing the http://localhost:8081/index.html link in the browser should show an outer space background, which you ...
Read now
Unlock full access