Comments (7)
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.
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.
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:
- 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 whereflame
comes in)
- 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)
- done using
The reason we want to use Flutter widgets
- for class, obviously
- much easier for building a pretty / interactive UI for the non-game-scene stuff (menu, settings, log in / log out, etc)
from flame.
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.
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.
I have 0.8.0 which fixes this issue! @Joseph-W-E, see if the solutions fits your needs :)
from flame.
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)
- Improve Klondike tutorial HOT 2
- Removed children are added again if parent component is moved to other parent HOT 4
- Add a flag to the `SpawnComponent` so that the creation position can be used instead.
- Calling remove and add components repeatedly during lifecycle change causes problem
- docs: potential improvement on animation docs
- Suggest adding a SectorHitbox HOT 13
- add liquid simulation HOT 3
- Gravity not work on stationary objects HOT 1
- Change `RiverpodComponentMixin.onLoad` to return `FutureOr<void>` HOT 3
- `ComponentParticle` fails with `CircleComponent` HOT 1
- Extreme CPU consumption / very low FPS on Ubuntu 22.04 HOT 1
- Let raycast dynamically ignore some hitboxes HOT 4
- when using FlameBlocProvider components seem to get created twice HOT 3
- Fix Component Lifecycle documentation HOT 2
- Allow ComponentRef access in RiverpodGameMixin HOT 9
- Children are not ordered by priority following add and remove HOT 2
- STOP breaking changes frequently! HOT 1
- `HasDraggables` not in flame engine code base HOT 2
- Using canvas.restore() in CustomPainterComponent is buggy HOT 6
- [space shooter tutorial] The position.x where Bullet is spawned at is unexpected. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flame.