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
try to draw vector of Mesh => ggez::graphics::mesh::Mesh is private module #787
Comments
Did you forget to run In particular I think the line with the error needs to be: |
line 53 private method |
There are two issues I see:
All together: let mut vec_of_mesh: Vec<graphics::Mesh> = Vec::new(); // use graphics::Mesh and not graphics::mesh::Mesh
let mb = mb.line(foo_A, foo_B, foo_C)?; // Handle the result first using '?'
let built_mesh = mb.build(ctx)?; // Then build the mesh (and yet again handle the result)
vec_of_mesh.push(built_mesh); // Finally store it in your vector Hope this helps. One other small thing. You have both use ggez::graphics;
...
use ggez::graphics::{Color, DrawMode}; but you can shorten this to use ggez::graphics::{self, Color, DrawMode}; I would recommend referring to these resources if you want to learn more: |
thank you everybody |
I dont know how to work with a vector of meshes to draw it
i got this error
let mut vec_of_mesh: Vecggez::graphics::mesh::Mesh = Vec::new();
| ^^^^ private module
vec_of_mesh.push(mb.line(foo_A, foo_B, foo_C).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct
ggez::graphics::mesh::Mesh
, found&mut ggez::graphics::mesh::MeshBuilder
my code
The text was updated successfully, but these errors were encountered: