vasturiano / three-spritetext

A sprite based text component for ThreeJS
https://vasturiano.github.io/three-spritetext/example/basic/
MIT License
340 stars 46 forks source link

Would this work in react native? #32

Open dulre159 opened 3 years ago

dulre159 commented 3 years ago

I would like to know if this would work in react native too. Currently i am using this in react-three-fiber and it works but would this work also in react native? I guess the "document.createElement('canvas');" would be the problem?

vasturiano commented 3 years ago

@dulre159 I haven't really tried to use this module in a React native app, so I cannot tell you if it works or not.

Being able to create a canvas element via document is an integral part of this functionality. So if React native doesn't expose a document global then this will be problematic. But I'm also not sure what would be a work-around this for creating canvas based Sprites in Three.

dulre159 commented 3 years ago

I don't think there is any document object in react-native but maybe a canvas can be create using react-native-canvas