switch.rs 776 B

123456789101112131415161718192021
  1. use crate::{
  2. mesh::Color,
  3. ui::{ShapeVertex, VectorShape},
  4. };
  5. pub fn create_switch(color: Color) -> VectorShape {
  6. VectorShape {
  7. verts: vec![
  8. ShapeVertex::from_xy(-1.1, -0.5, color),
  9. ShapeVertex::from_xy(1.7, -0.2, color),
  10. ShapeVertex::from_xy(-1.7, -0.2, color),
  11. ShapeVertex::from_xy(0.9, -0.5, color),
  12. ShapeVertex::from_xy(0.3, -1.4, color),
  13. ShapeVertex::from_xy(1.1, 0.5, color),
  14. ShapeVertex::from_xy(-1.7, 0.2, color),
  15. ShapeVertex::from_xy(1.7, 0.2, color),
  16. ShapeVertex::from_xy(-0.9, 0.5, color),
  17. ShapeVertex::from_xy(-0.3, 1.4, color),
  18. ],
  19. indices: vec![3, 2, 1, 8, 7, 6, 1, 4, 3, 3, 0, 2, 8, 5, 7, 6, 9, 8],
  20. }
  21. }