#component #entity #bevy-ecs #hook #spawn #bevy-ui #spawning

i-cant-believe-its-not-bsn

Tools for spawning entity hierarchies in Bevy

2 releases

0.1.1 Oct 17, 2024
0.1.0 Oct 6, 2024

#1559 in Game dev

Download history 159/week @ 2024-10-06 191/week @ 2024-10-13 37/week @ 2024-10-20 5/week @ 2024-10-27 3/week @ 2024-11-03

53 downloads per month

MIT/Apache

20KB
339 lines

i-cant-believe-its-not-bsn

An ergonomic way to spawn Bevy entity hierarchies using component hooks and the magic of the type system.

Eagerly waiting for BSN? Really wish you could spawn hierarchies with less boilerplate? Just want to define some reusable widget types for bevy_ui in code?

Try WithChild, or its iterator sibling, WithChildren! Just add it as a component holding the bundle you want to use to spawn the child, and you're off to the races. A component hook will see that this component has been added, extract the data from your WithChild component, and then move it into a child, cleaning itself up as it goes.

Have fun!

Dependencies

~8–11MB
~183K SLoC