File tree 2 files changed +6
-9
lines changed
2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 27
27
"@babylonjs/core" : " 5.1.0" ,
28
28
"@babylonjs/gui" : " 5.1.0" ,
29
29
"@babylonjs/loaders" : " 5.1.0" ,
30
- "@flyskywhy/react-native-gcanvas" : " 5.0.0 " ,
30
+ "@flyskywhy/react-native-gcanvas" : " 5.0.1 " ,
31
31
"@githubprimer/octicons-react" : " ^8.5.0" ,
32
32
"@react-navigation/native" : " ^6.0.10" ,
33
33
"@react-navigation/native-stack" : " 6.6.2" ,
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { Engine , Scene } from 'react-babylonjs' ;
2
+ import { View } from 'react-native' ;
3
+ import { Engine , Scene } from 'react-native-babylonjs' ;
3
4
import { Vector3 , Color3 } from '@babylonjs/core' ;
4
5
5
6
// start copy from https://www.babylonjs.com/demos/dragndrop/dragdrop.js
@@ -8,11 +9,9 @@ const validateDrag = (targetPosition) => {
8
9
return Math . max ( Math . abs ( targetPosition . x ) , Math . abs ( targetPosition . z ) ) <= ( GROUND_SIZE / 2 ) - 10 ; // should be -15 for torus
9
10
}
10
11
11
- function dragNdrop ( ) {
12
+ function dragNdrop ( ) {
12
13
return (
13
- < div >
14
- < div className = "row" >
15
- < div className = "col-xs-12 col-md-12" >
14
+ < View style = { { flex : 1 } } >
16
15
< Engine antialias = { true } engineOptions = { { preserveDrawingBuffer :true , stencil :true } } canvasId = "sample-canvas" >
17
16
< Scene clearColor = { new Color3 ( 0 , 0 , 0 ) } >
18
17
< pointLight name = 'omni' position = { new Vector3 ( 0 , 50 , 0 ) } />
@@ -45,9 +44,7 @@ function dragNdrop() {
45
44
</ torus >
46
45
</ Scene >
47
46
</ Engine >
48
- </ div >
49
- </ div >
50
- </ div >
47
+ </ View >
51
48
) ;
52
49
}
53
50
You can’t perform that action at this time.
0 commit comments