Skip to content

Commit

Permalink
Viro Linking Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
EinarLop committed Mar 21, 2023
1 parent 72ef5df commit 085958b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 118 deletions.
57 changes: 57 additions & 0 deletions App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React, {useState} from 'react';
import {StyleSheet} from 'react-native';
import {
ViroARScene,
ViroText,
ViroARSceneNavigator,
} from '@viro-community/react-viro';

import '@viro-community/react-viro/dist/components/ViroConstants.d.ts';

const HelloWorldSceneAR = () => {
const [text, setText] = useState('Initializing AR...');

function onInitialized(state, reason) {
// console.log('guncelleme', state, reason);
// if (state === ViroConstants.TRACKING_NORMAL) {
setText('Hello World!');
console.log(TRACKING_NORMAL);
// } else if (state === ViroConstants.TRACKING_NONE) {
// // Handle loss of tracking
// }
}

return (
<ViroARScene onTrackingUpdated={onInitialized}>
<ViroText
text={text}
scale={[0.5, 0.5, 0.5]}
position={[0, 0, -1]}
style={styles.helloWorldTextStyle}
/>
</ViroARScene>
);
};

export default () => {
return (
<ViroARSceneNavigator
autofocus={true}
initialScene={{
scene: HelloWorldSceneAR,
}}
style={styles.f1}
/>
);
};

var styles = StyleSheet.create({
f1: {flex: 1},
helloWorldTextStyle: {
fontFamily: 'Arial',
fontSize: 30,
color: '#ffffff',
textAlignVertical: 'center',
textAlign: 'center',
},
});
118 changes: 0 additions & 118 deletions App.tsx

This file was deleted.

0 comments on commit 085958b

Please sign in to comment.