pub fn make_rectangle(pos: &Vec3f, size: &Vec2f) -> UiElementVertexQuad {
    let half_w = size.width() / 2.;
    let half_h = size.height() / 2.;
    let x = pos.x;
    let y = pos.y;
    let _z = pos.z;

    let vertices: UiElementVertexQuad = svec![
        // Top left
        Vertex::new(Vec3f::new(x - half_w, 1., y - half_h), Vec2f::new(1., 0.),),
        // Top right
        Vertex::new(Vec3f::new(x + half_w, 1., y - half_h), Vec2f::new(0., 0.),),
        // Bottom left
        Vertex::new(Vec3f::new(x + half_w, 1., y + half_h), Vec2f::new(0., 1.),),
        // Bottom right
        Vertex::new(Vec3f::new(x - half_w, 1., y + half_h), Vec2f::new(1., 1.),),
    ];

    vertices
}
/// Create 2D vertices for UI elements.
Create 2D vertices for UI elements.
Create 2D vertices for UI elements .
pub fn make_rectangle(pos: &Vec3f, size: &Vec2f) -> UiElementVertexQuad {
    let half_w = size.width() / 2.;
    let half_h = size.height() / 2.;
    let x = pos.x;
    let y = pos.y;
    let _z = pos.z;
    let vertices: UiElementVertexQuad = svec![
        // Top left
        Vertex::new(Vec3f::new(x - half_w, 1., y - half_h), Vec2f::new(1., 0.),),
        // Top right
        Vertex::new(Vec3f::new(x + half_w, 1., y - half_h), Vec2f::new(0., 0.),),
        // Bottom left
        Vertex::new(Vec3f::new(x + half_w, 1., y + half_h), Vec2f::new(0., 1.),),
        // Bottom right
        Vertex::new(Vec3f::new(x - half_w, 1., y + half_h), Vec2f::new(1., 1.),),
    ];
    vertices
}
pub fn make_rectangle ( pos : & Vec3f , size : & Vec2f ) -> UiElementVertexQuad { let half_w = size . width ( ) / 2. ; let half_h = size . height ( ) / 2. ; let x = pos . x ; let y = pos . y ; let _z = pos . z ; let vertices : UiElementVertexQuad = svec ! [ // Top left Vertex new ( Vec3f new ( x half_w 1. y half_h ) Vec2f new ( 1. 0. ) ) // Top right Vertex new ( Vec3f new ( x half_w 1. y half_h ) Vec2f new ( 0. 0. ) ) // Bottom left Vertex new ( Vec3f new ( x half_w 1. y half_h ) Vec2f new ( 0. 1. ) ) // Bottom right Vertex new ( Vec3f new ( x half_w 1. y half_h ) Vec2f new ( 1. 1. ) ) ] ; vertices }
Create 2D vertices for UI elements.
Create 2D vertices for UI elements .
pos
&Vec3f
size
&Vec2f
pos
&Vec3f
size
&Vec2f