coronalabs / corona

Solar2D Game Engine main repository (ex Corona SDK)
https://solar2d.com/
MIT License
2.49k stars 267 forks source link

Feature request: Corona Cards for React Native #117

Open Beekiper opened 4 years ago

Beekiper commented 4 years ago

Hi!

Do Corona Cards work with React Native? Will they ever?

Have a sweet day!

Larpoux commented 4 years ago

I would like too that S2D will work with React Native. It would be really great Actually I am working on a plugin so that Flutter will support Solar2D, (because I know Flutter better than React Native). Probably/perhaps I will work on React Native under S2d when I will have finished with Flutter. Not tomorrow 👀 for sure 😆

Have a nice day.

doroodyan commented 3 years ago

hi is there any news about using corona cards in react native or flutter?

Larpoux commented 3 years ago

Unfortunately I was busy with two other projects and I had not time for this. But this is something I really want to do soon (march? april?).

I was able to start a flutter engine as a s2D plugin, and switch the screen from S2D to flutter and then back from flutter to S2D. But this was just a prototype. Unfortunately I was not able to use the S2D simulator with my prototype, because I was not able to create a macOS plugin (or linux) with a flutter engine. This is really bad, because the S2D simulator is great.

I created a very simple flutter screen with some LUA code and was able to execute a LUA expression when the end user clicked a Flutter button. It was just as a prove of concept : Work must be done to support a large panel of Flutter Widgets.

Actually I am not sure if it is better to create a S2D plugin with a flutter engine embedded (its what I did), or a Flutter plugin with a S2D engine embedded. Both architectures is probably same for the developer. Actually I think that doing a flutter plugin is perhaps better because S2D is not stable enough and must be patched.

Another point is : perhaps it should be better to do a RN development instead of Flutter at first (we probably want to support both in the future).

This project is really interesting, and I want to do it. I just worried that nobody would be interested by that. Thank you for this post : if I know that some users are interested by this project I will not delay it anymore from month to month.

Larpoux commented 3 years ago

I want to explain a little more why it is same for the developer if we architecture the project as a flutter plugin or a S2D plugin. In both cases the goal is to allow the developer to build its screens entirely with LUA. Some screens will be handled by S2D, and some other by Flutter. But everything will be developped in LUA. Not Dart, not Javascript, not Objective C or java.

If we create a very simple "player" with hot reload (as does S2D), the developer does not need to bother with Flutter installation, Android or XCode during the developments. He/she just need an iOS or Android emulator. S2D can do that and it is probably one of the best thing it can do. Our new project must be able to do same.

Larpoux commented 3 years ago

A last note : Being able to create both S2D screens and Flutter screens is something like creating a two-headed monster. Much better would be to be able to display a S2D form inside a Flutter Widget. Flutter has several openGL widgets. Perhaps it is possible to render a S2D form as an openGL texture for those widgets.

I know almost nothing about openGL, I have no idea if it is feasible.