You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a CircleComponent with ComponentParticle, an exceptions gets raised for CircleComponent._centerOffset not being initialized. This happens because components added to ComponentParticle are not really part of the component tree. This mean they never get correctly loaded and mounted. ComponentParticle only makes sure to invoke the render and update method of the component that it encapsulates, essentially skipping all the standard component lifecycle processing.
Expected behavior
CircleComponent, should work with ComponentParticle. Ideally any kind of component should working with ComponentParticle.
Steps to reproduce
Adding following code to any game should reproduce the problem.
════════ Exception caught by rendering library ═════════════════════════════════
The following LateError was thrown during paint():
LateInitializationError: Field '_centerOffset@1199492026' has not been initialized.
More information
I can only think of converting the Particle class into a Component 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:
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.
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: