#[repr(C)]
pub struct QuadIns { pub rect_pos: Vec2, pub rect_size: Vec2, pub draw_depth: f32, }
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

Common Shader code for using QuadIns.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.