bevy_prototype_lyon icon indicating copy to clipboard operation
bevy_prototype_lyon copied to clipboard

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

Open lordbenedikt opened this issue 3 years ago • 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?

lordbenedikt avatar Mar 28 '22 13:03 lordbenedikt

You can use a PathBuilder

zimond avatar May 07 '22 10:05 zimond

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

lordbenedikt avatar Jun 13 '22 14:06 lordbenedikt

@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 avatar Jun 16 '22 04:06 zimond

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

lordbenedikt avatar Jun 24 '22 21:06 lordbenedikt

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?

enaut avatar Aug 22 '22 06:08 enaut