GithubHelp home page GithubHelp logo

Comments (7)

ahalforc avatar ahalforc commented on May 6, 2024

I've taken a stab at allowing transitioning between flutter widgets and the game scene:
https://github.com/Joseph-W-E/flame/commit/5dfa97a07ded97b6a570ee477d106bfd01af27d7
There's still infinite exceptions thrown, but for this being a class project that's due soon, I'm going to shamefully pretend they don't exist.
Edit: It works, though. I can runApp(myWidget), then game.start(), game.stop() and get back to my flutter widgets.

from flame.

feroult avatar feroult commented on May 6, 2024

Hi @Joseph-W-E

Great you are enjoying Flame!

Would you please explain the specific use case where you need to transition to Flutter widgets?

We've been discussing about this, it would be great to understand your needs.

Regards

from flame.

ahalforc avatar ahalforc commented on May 6, 2024

Sure thing. https://github.com/Joseph-W-E/angry_arrows is a project I'm working on for fun / class. Basically, the class is an Android specific class, but we are allowed to use Flutter under the guise that we demonstrate how Flutter's UI architecture differ from Android's. To have some fun with this, we (my friend and I) are making a simple game that has two parts:

  1. The home screen / main menu
    • this is done using Flutter Widgets
    • a button callback can invoke loadGameScene() to kick off the game engine (this is where flame comes in)
  2. The game engine
    • done using flame
    • a very simple game (launch arrows into crates)
    • the game has a "back button" that invokes a callback (brings us back to Flutter Widgets)

The reason we want to use Flutter widgets

  1. for class, obviously
  2. much easier for building a pretty / interactive UI for the non-game-scene stuff (menu, settings, log in / log out, etc)

from flame.

luanpotter avatar luanpotter commented on May 6, 2024

This is a very important use case and one we definitely intend to support. Currently, as @feroult mentioned, there has been some discussion but we didn't find a clear-cut best way to do it. In fact, we ought to rework the whole ServiceBinding strategy because of the supermixins issue.

I'll definitely take a look at your code soon, and if we can fix all the exceptions, we can PR you :))

Thanks for your input!

from flame.

ahalforc avatar ahalforc commented on May 6, 2024

Sounds good! For what it's worth, here's my solution thus far. I've gotten rid of the exceptions happening on each frame, and have finally reached a bandaid solution good enough for this little project.

https://github.com/Joseph-W-E/flame/pull/1/files?diff=split

from flame.

luanpotter avatar luanpotter commented on May 6, 2024

I have 0.8.0 which fixes this issue! @Joseph-W-E, see if the solutions fits your needs :)

from flame.

luanpotter avatar luanpotter commented on May 6, 2024

This was no longer an issue on our tests, and the systems are very well integrated.

Feel free to open a new issue if you encounter any problem whatsoever, we'd love to help :)

from flame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.