-
-
Notifications
You must be signed in to change notification settings - Fork 899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ComponentParticle
fails with CircleComponent
#2962
Labels
Comments
Hmm, good catch. I don't think we'd want to convert particle to a real component since they are much heavier and you might have thousands of particles. Not sure what a good solution here could be. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current bug behavior
When using a
CircleComponent
withComponentParticle
, an exceptions gets raised forCircleComponent._centerOffset
not being initialized. This happens because components added toComponentParticle
are not really part of the component tree. This mean they never get correctly loaded and mounted.ComponentParticle
only makes sure to invoke therender
andupdate
method of the component that it encapsulates, essentially skipping all the standard component lifecycle processing.Expected behavior
CircleComponent
, should work withComponentParticle
. Ideally any kind of component should working withComponentParticle
.Steps to reproduce
Adding following code to any game should reproduce the problem.
Flutter doctor output
N.A.
More environment information
Flame version: 1.14.0
Platform affected: All
Log information
More information
I can only think of converting the
Particle
class into aComponent
to make it work properly for all components. This sounds like a big change and I probably won't have enough time to working on this, so reporting this issue.But there are more such component-like classes which I think need to be streamlined.
EffectController
is one such example where they need to be ticked every frame.The text was updated successfully, but these errors were encountered: