We will learn how to set up a React VR project, run the development mode with hot reloading, and take a small dive into the generated code and make a small change.

Install:

npm -g i react-vr-cli

Create app:

react-vr init app

Enable hotreload:

localhost:/vr/?hotreload
import React from 'react';
import {
AppRegistry,
asset,
Pano,
Text,
View,
} from 'react-vr'; export default class app extends React.Component {
render() {
return (
<View>
<Pano
style={{
transform: [{rotateY: "10deg"}]
}}
onLoad={() => {console.log('Image is loaded successfully')}}
onLoadEnd={() => {console.log('Load end')}}
source={asset('mittel.jpg')}
/>
<Text
style={{
backgroundColor: '#777879',
fontSize: 0.8,
fontWeight: '400',
layoutOrigin: [0.5, 0.5],
paddingLeft: 0.2,
paddingRight: 0.2,
textAlign: 'center',
textAlignVertical: 'center',
transform: [{translate: [0, 0, -3]}],
}}>
hello world
</Text>
</View>
);
}
}; AppRegistry.registerComponent('app', () => app);

'source' can also take array of assets:

<Pano
source={[asset('right.png'), asset('left.png'), asset('up.png'), asset('down.png'), asset('back.png'), asset('front.png')]}
/>

最新文章

  1. php 自动绑定di容器实现
  2. 1236 - Pairs Forming LCM -- LightOj1236 (LCM)
  3. MySQL字符集乱码
  4. Ubuntu 12.04(32位)安装Oracle 11g(32位)
  5. editplus3运行Python程序
  6. System.Net网络编程--AuthenticationManager和IAuthenticationModule
  7. The type MultipartEntity is deprecated
  8. Python中collections模块
  9. 前端笔记之NodeJS(二)路由&amp;REPL&amp;模块系统&amp;npm
  10. python3 练习题(用函数完成登录注册以及购物车的功能)
  11. javaScript系列 [06]-javaScript和this
  12. 动态开点线段树(陕西师范18k题)---get new skill
  13. 2018.11.01 NOIP训练 递增数列(迭代加深)
  14. spring 通过@Value 获取properties文件中设置了属性 ,与@Value # 和$的区别
  15. ASP.NET Web API 全局权限和异常处理
  16. 理解 JavaScript 中的 Function.prototype.bind
  17. sql server中的 trimtrailingblanks
  18. vuex(三)actions
  19. Dell 1420N使用Kubuntu默认无线驱动后网络不稳定的解决方法
  20. HTML表单页面的运用

热门文章

  1. [MongoDB实战]Part1 起步
  2. HDU 4686
  3. HDU 2817 EASY题
  4. WebGL 权威资源站小聚
  5. swift-初探webView与JS交互
  6. 【POJ 2182】Lost Cows
  7. 参照实验室这边案例做一个简单的maven webapp项目
  8. Fine-tuning CaffeNet for Style Recognition on “Flickr Style” Data 数据下载遇到的问题
  9. 在eclipse环境下使用maven install 命令碰到native2ascii-utf8问题解决方案
  10. 一种比较高级的方法也可以修改windows为默认启动系统