-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Explanation for the '2d shapes' example #19211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explanation for the '2d shapes' example #19211
Conversation
examples/2d/2d_shapes.rs
Outdated
//! | ||
//! Thankfully, we can add shape primitives directly to `Assets<Mesh>` because `Mesh` implements `From` for shape primitives and `Assets<T>::add` can be given any value that can be "turned into" `T`! | ||
//! | ||
//! We apply a material to the shape by first making a `Color` then calling `Assets<ColorMaterial>::add` with that color as its argument, which will create a material from that color through the same process `Assets<Mesh>::add` can take a shape primitive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could these inline code snippets be intra-link doc comments ? That would ensure we don't forget updating them if they change somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving, but doc links would be neat if possible :)
I'll get on that! We might need an eye for some further post-processing than what we already do with the docs extraction. As it stands, examples like fixed timestep have to hard-link docs to not appear as "[ |
I'm a bit concerned about the possibility intra-docs will cause too much friction for people doing breaking API changes, as example docs are intended to be discarded if things are too catastrophic wrong and not supposed to get in the way overall. For now, I'll be avoiding them on my examples until there's some more clarity. |
Co-authored-by: theotherphil <phil.j.ellison@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the tone and target audience: nice stuff!
Explanation for the 2d shapes example, taken from the original HackMD document and edited a bit.
This example is a strange one, it's eye-catching mostly because it's the first example (at time of writing) in the examples page. That being said, the example does a decent amount of teaching utility to it: we can explain the bevy math-shape to mesh pipeline, which illuminates a way of transforming one form of data (abstract, mathematical shape descriptions) into another (meshes) which may be novel or inspirational to some users.