forked from brianzinn/create-react-app-babylonjs
-
Notifications
You must be signed in to change notification settings - Fork 3
/
App.tsx
171 lines (165 loc) · 5.46 KB
/
App.tsx
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/**
* GCanvas React Native Examples
* https://github.com/flyskywhy/react-native-gcanvas
*
* @format
* @flow strict-local
*/
import React from 'react';
import {Button, Platform, View, StatusBar} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import Canvas2dDemoScreen from './app/components/Canvas2dDemo';
import RotateRemount2MemoryLeakScreen from './app/components/RotateRemount2MemoryLeak';
import DrawCanvas2CanvasScreen from './app/components/DrawCanvas2Canvas';
import FontPicker2FillTextScreen from './app/components/FontPicker2FillText';
import ZdogAndTestsScreen from './app/components/ZdogAndTests';
import AudioFrequencyHistogramScreen from './app/components/AudioFrequencyHistogram';
import AudioWaveSurferScreen from './app/components/AudioWaveSurfer';
import Webgl3dTexturesScreen from './app/components/Webgl3dTextures';
import WebglCubeMapsScreen from './app/components/WebglCubeMaps';
import PixiScreen from './app/components/Pixi';
import DragNDropScreen from './src/dragNdrop';
import NonDeclarativeScreen from './src/nonDeclarative';
import PixelShapeRNScreen from './app/components/PixelShapeRNScreen';
if (Platform.OS !== 'web') {
require('react-native').LogBox.ignoreLogs([
'React Components must start with an uppercase letter',
]);
}
function HomeScreen({navigation}) {
return (
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<Button
title="Canvas 2d Demo"
onPress={() => navigation.navigate('Canvas2dDemo')}
/>
<Button
title="Rotate Remount to test Memory Leak"
onPress={() => navigation.navigate('RotateRemount2MemoryLeak')}
/>
<Button
title="Draw Canvas to Canvas"
onPress={() => navigation.navigate('DrawCanvas2Canvas')}
/>
<Button
title="Font Picker to fillText"
onPress={() => navigation.navigate('FontPicker2FillText')}
/>
<Button
title="Zdog and Tests"
onPress={() => navigation.navigate('ZdogAndTests')}
/>
<Button
title="Audio Frequency Histogram"
onPress={() => navigation.navigate('AudioFrequencyHistogram')}
/>
<Button
title="Audio Wave Surfer"
onPress={() => navigation.navigate('AudioWaveSurfer')}
/>
<Button
title="Webgl 3d Textures"
onPress={() => navigation.navigate('Webgl3dTextures')}
/>
<Button
title="Webgl Cube Maps"
onPress={() => navigation.navigate('WebglCubeMaps')}
/>
<Button title="PixiJS" onPress={() => navigation.navigate('PixiJS')} />
<Button
title="babylonjs Drag and drop"
onPress={() => navigation.navigate('DragNDrop')}
/>
<Button
title="babylonjs Non-Declarative"
onPress={() => navigation.navigate('NonDeclarative')}
/>
<Button
title="Pixel Shape RN"
onPress={() => navigation.navigate('PixelShapeRN')}
/>
</View>
);
}
const Stack = createNativeStackNavigator();
function App(): JSX.Element {
return (
<NavigationContainer>
<StatusBar barStyle="dark-content" />
<Stack.Navigator initialRouteName="Home">
<Stack.Screen
name="Home"
component={HomeScreen}
options={{title: 'GCanvas React Native Examples'}}
/>
<Stack.Screen
name="Canvas2dDemo"
component={Canvas2dDemoScreen}
options={{title: 'Canvas 2d Demo'}}
/>
<Stack.Screen
name="RotateRemount2MemoryLeak"
component={RotateRemount2MemoryLeakScreen}
options={{title: 'Rotate Remount to test Memory Leak'}}
/>
<Stack.Screen
name="DrawCanvas2Canvas"
component={DrawCanvas2CanvasScreen}
options={{title: 'Draw Canvas to Canvas'}}
/>
<Stack.Screen
name="FontPicker2FillText"
component={FontPicker2FillTextScreen}
options={{title: 'Font Picker to fillText'}}
/>
<Stack.Screen
name="ZdogAndTests"
component={ZdogAndTestsScreen}
options={{title: 'Zdog and Tests'}}
/>
<Stack.Screen
name="AudioFrequencyHistogram"
component={AudioFrequencyHistogramScreen}
options={{title: 'Audio Frequency Histogram'}}
/>
<Stack.Screen
name="AudioWaveSurfer"
component={AudioWaveSurferScreen}
options={{title: 'Audio Wave Surfer'}}
/>
<Stack.Screen
name="Webgl3dTextures"
component={Webgl3dTexturesScreen}
options={{title: 'Webgl 3d Textures'}}
/>
<Stack.Screen
name="WebglCubeMaps"
component={WebglCubeMapsScreen}
options={{title: 'Webgl Cube Maps'}}
/>
<Stack.Screen
name="PixiJS"
component={PixiScreen}
options={{title: 'PixiJS'}}
/>
<Stack.Screen
name="DragNDrop"
component={DragNDropScreen}
options={{title: 'Drag and drop'}}
/>
<Stack.Screen
name="NonDeclarative"
component={NonDeclarativeScreen}
options={{title: 'Non-Declarative'}}
/>
<Stack.Screen
name="PixelShapeRN"
component={PixelShapeRNScreen}
options={{title: 'Pixel Shape RN'}}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;