Nilirad/bevy_prototype_lyon

Is it possible to combine multiple shapes and treat them as a single shape?

lordbenedikt opened this issue · 5 comments

I'm using this library to draw debug_shapes. Some of the shapes can't be represented by any of the provided shape types alone. Could they be combined though, it would perfectly work. Is it possible to do that?

You can use a PathBuilder

What if I need a shape that isn't made up of a continuous line i.e. an X?

@lordbenedikt you could just call .move_to(), each call starts a new segment. This is identical to the concept of path building in the SVG spec.

@zimond thanks, I didn't know about that!

enaut commented

But it would be great to impl Add<PathBuilder> for PathBuilder so I could predefine two unbuilt paths and combine the shapes. Or do I completely misunderstand the concept?