Expand description
QuadIns
is the basis for most draw structs.This renders a rectangle.
There are some default shaders available at QuadIns::SHADER
.
Example usage with your own struct:
struct MyStruct {
pub base: QuadIns,
pub field1: f32,
pub field2: f32,
}
And render using:
let s = MyStruct {
base: QuadIns::from_rect(rect),
field1: 0.0,
field2: 0.0,
};
cx.add_instances(&SHADER, &[s]);
Fields
rect_pos: Vec2
The top-left corner position of the quad, in absolute coordinates.
rect_size: Vec2
The size of the quad.
draw_depth: f32
Z-index.
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for QuadIns
impl UnwindSafe for QuadIns
Blanket Implementations
Mutably borrows from an owned value. Read more