bberak / react-game-engine

A lightweight Game Engine for the web (React) 🕹⚡🎮
MIT License
420 stars 25 forks source link

Usage in React Native #27

Closed NilsBaumgartner1994 closed 1 year ago

NilsBaumgartner1994 commented 1 year ago

I know that there exists a specific package for react native. But i would realy love it to use RGE in my cross plattform (web, android, ios) app. Currently my plan is to create cross wrappers.

I would ask if it is possible to use "View" instead of "divs" since they dont realy make a difference.

bberak commented 1 year ago

Hey @NilsBaumgartner1994,

I wasn't aware that "View" was actually a thing in web? 🤔 If so, then yeah it would be possible I guess.. One problem though might be the event handling mechanics.. That would also need to be updated to have a seamless experience.. The web version (RGE) uses a much simpler event handling mechanism - whereas the React Native adds some unnecessary complexity..

How are you planning to use RGE cross platform with iOS and Android? I would've guessed that using RNGE on web might be more do-able since tools like Expo support web now.. In any case - you could also consider packaging your logic (systems) in a separate module, than sharing that between web and mobile platforms..

NilsBaumgartner1994 commented 1 year ago

Hi there,Yes that is my plan to use it as across all platforms (web, iOS, android). Currently I am building wrappers for „input“ and „events“ which just check where the user pressed/clicked. I think that this could be easily merged.Also View is a big thing in web, considering the cross support. RNGE does not seems to work properly on web. I am currently more in the testing phase, but I am afraid that I will have to use both RGE and RNGE.The first goal for the „game“ should be just some simple parallax scenes.I believe this seamless experience would give a huge benefit in developing. Beste Grüße,Nils BaumgartnerAm 17.03.2023 um 07:32 schrieb Boris Berak @.***>: Hey @NilsBaumgartner1994, I wasn't aware that "View" was actually a thing in web? 🤔 If so, then yeah it would be possible I guess.. One problem though might be the event handling mechanics.. That would also need to be updated to have a seamless experience.. The web version (RGE) uses a much simpler event handling mechanism - whereas the React Native adds some unnecessary complexity.. How are you planning to use RGE cross platform with iOS and Android? I would've guessed that using RNGE on web might be more do-able since tools like Expo support web now.. In any case - you could also consider packaging your logic (systems) in a separate module, than sharing that between web and mobile platforms..

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

bberak commented 1 year ago

Hey @NilsBaumgartner1994,

Could you send me a link to any documentation about using View in a web/HTML5 context. I haven't been able to find any concrete information :/

NilsBaumgartner1994 commented 1 year ago

For react App self it works with div. But having a cross platform app (web + native) divs don’t work.Have a look @./flash-listCurrently my idea is to write a wrapper for my purpose handling the inputs as you said for native and web. It’s not that much but I think it would be much easier to develop things for web and nativeBeste Grüße,Nils BaumgartnerAm 17.03.2023 um 07:32 schrieb Boris Berak @.>: Hey @NilsBaumgartner1994, I wasn't aware that "View" was actually a thing in web? 🤔 If so, then yeah it would be possible I guess.. One problem though might be the event handling mechanics.. That would also need to be updated to have a seamless experience.. The web version (RGE) uses a much simpler event handling mechanism - whereas the React Native adds some unnecessary complexity.. How are you planning to use RGE cross platform with iOS and Android? I would've guessed that using RNGE on web might be more do-able since tools like Expo support web now.. In any case - you could also consider packaging your logic (systems) in a separate module, than sharing that between web and mobile platforms..

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

bberak commented 1 year ago

Hey @NilsBaumgartner1994,

Going back to your initial request:

I would ask if it is possible to use "View" instead of "divs" since they dont realy make a difference.

I don't see how it would be possible to use "View" in this package since it targets web - and "View" is React-Native component. FlashList is a React-Native package so it makes sense that they are using "View".

Sorry if I misunderstood your request.