Hi!

I’ve been learning Bevy and LOVING IT, there’s only one thing confusing me. Many components appear to be created magically even if not specified in the Bundle passed to commants.spawn.

For example, when I spawn just a Sprite component, the entity seems to automatically get a Transform component, even if I didn’t give it one.

Similarly, this example spawns a Screenshot component, which apparently results in a Capturing component that can be queried later.

Are these “implicit” components documented somewhere? I took a short look at the TransformPlugin for example but I can’t seem to figure out where these components come from.

Thanks y’all!

  • PotatoesFall@discuss.tchncs.deOP
    link
    fedilink
    arrow-up
    2
    ·
    2 months ago

    Thanks so much!

    I just managed to find the place where the Capturing component gets added, it’s part of the extract_screenshots system in the ScreenshotPlugin.

    For Sprite, another user found where this originates from, it’s the require attribute.

    • CodexArcanum@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 months ago

      Nice! Glad you worked it out!

      I got so excited to see a Bevy post (in the Bevy community even!) I really want to see the gamedev community here pick up and exceed reddit, SO, and other company-owned gaming forums.