Can't draw Segment2D: the trait MeshBuilder
is not implemented for bevy::prelude::Segment2d
#19975
Unanswered
g-alexander
asked this question in
Q&A
Replies: 1 comment
-
You'll have to create your own custom type and implement |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How draw a simple segment?
My code
let mesh = Mesh2d(meshes.add(Segment2d::new(Vec2::new(-30.0, 0.0), Vec2::new(30.0, 0.0)))); let material = MeshMaterial2d(materials.add(Color::LinearRgba(LinearRgba{red: 1.0, green: 0.0, blue: 0.0, alpha: 1.0}))); commands.spawn((mesh, material, Transform::from_xyz(0.0, 0.0, 0.0)));
throws an error: the trait
MeshBuilder
is not implemented forbevy::prelude::Segment2d
Thank's.
Beta Was this translation helpful? Give feedback.
All reactions