Nilirad / bevy_prototype_lyon

Draw 2D shapes in Bevy
Apache License 2.0
702 stars 87 forks source link

Remove dedicated `SystemStage` #163

Closed JoJoJet closed 2 years ago

JoJoJet commented 2 years ago

This allows much more flexibility when building shapes. Currently, any shape building code must occur in or before Update, or else there will be visual flickering due to the frame delay. Moving the stage after PostUpdate gives the programmer more freedom, and allows shapes to be based on up-to-date GlobalTransforms.

JoJoJet commented 2 years ago

Another question... why does bevy_prototype_lyon::Stage even exist? Is there a reason we couldn't just drop the system into PostUpdate and expose a public SystemLabel?

Nilirad commented 2 years ago

Hmm, yeah, I once added the system between Update and PostUpdate because I wanted the shape to render without delay, but putting in the PostUpdate resulted in some rendering problems that I don't fully remember. But this seems to no longer be the case.

Can you please also move the system directly in the PostUpdate stage and see if it still works? If it does, we can also remove the Shape stage.

JoJoJet commented 2 years ago

I removed the stage and it seems to work. Unit tests pass and examples seem good. There's a SystemLabel for any users who need to order based on the mesh building system.

Nilirad commented 2 years ago

I'll test it as soon as I get home, then if it's all OK I'll merge it :)

JoJoJet commented 2 years ago

I realized that I previously forgot to order the system after transform_propagate_system. I should be done with this PR now unless something comes up.

Nilirad commented 2 years ago

Oops, I just forgot about that PR 😅

LGTM. Merging...