pub fn vertices(&self) -> Vec<&[Vertex2d]> {
        let layers: Vec<&Layer> = self
            .render_order
            .iter()
            .map(|handle| self.layers.get(handle).unwrap())
            .collect();

        let mut verts: Vec<&[Vertex2d]> = vec![];
        for layer in layers {
            verts.reserve(layer.batches.len());
            for batch in &layer.batches {
                verts.push(&batch.vertices);
            }
        }
        verts
    }
/// Get the slice of all vertices for all layers and batches in order.
///
/// This can be used to build a vertex buffer when rendering.
///
/// The layout of the vertices is like the following:
///
/// - Layer
///   - Batch vertices
///   - Batch vertices
/// - Layer
///   - Batch vertices
/// - Layer
///   - Batch vertices
///   - Batch vertices
///   - Batch vertices
///
Get the slice of all vertices for all layers and batches in order.
This can be used to build a vertex buffer when rendering.

The layout of the vertices is like the following.


Get the slice of all vertices for all layers and batches in order . This can be used to build a vertex buffer when rendering . The layout of the vertices is like the following .
pub fn vertices(&self) -> Vec<&[Vertex2d]> {
        let layers: Vec<&Layer> = self
            .render_order
            .iter()
            .map(|handle| self.layers.get(handle).unwrap())
            .collect();
        let mut verts: Vec<&[Vertex2d]> = vec![];
        for layer in layers {
            verts.reserve(layer.batches.len());
            for batch in &layer.batches {
                verts.push(&batch.vertices);
            }
        }
        verts
    }
pub fn vertices ( & self ) -> Vec < & [ Vertex2d ] > { let layers : Vec < & Layer > = self . render_order . iter ( ) . map ( | handle | self . layers . get ( handle ) . unwrap ( ) ) . collect ( ) ; let mut verts : Vec < & [ Vertex2d ] > = vec ! [ ] ; for layer in layers { verts . reserve ( layer . batches . len ( ) ) ; for batch in & layer . batches { verts . push ( & batch . vertices ) ; } } verts }
Get the slice of all vertices for all layers and batches in order.
Get the slice of all vertices for all layers and batches in order .
&self