I know this is a very basic question, but how do you draw lines in amethyst? I want to draw a line between two 2d sprites with a given width and color.
I’ve looked through the documentation, and found a few potential solutions, none of which I’m satisfied with.
Use DebugLines. This seems like the most straightforward solution, but
- I can’t control the line’s thickness.
- I’m not using this to “debug” anything.
Use a rectangular Sprite and transform it to get the appropriate length, angle, and width.
- This is a workable solution, but the result looks a bit ugly. How do I control AntiAliasing?
Use a 2d Mesh.
I haven’t been able to get this working. How do I create a Mesh from 4 points? (The only examples I’ve found show how to load meshes from a file, which seems like overkill for a short line)
let mesh = Mesh::builder() .with_vertices(verts) .into(); // The above gives a `MeshData`, but I think I need a // `Handle<Mesh>` component to add to the entity