pub struct DrawBuilder<'a, T: 'a> { /* private fields */ }
Expand description
A rectangle builder.
Obtained from Renderer::rect()
or Renderer::fill()
Implementations§
Source§impl<'a, T> DrawBuilder<'a, T>
impl<'a, T> DrawBuilder<'a, T>
The following implementations are available when drawing with Renderer::rect()
or Renderer::fill()
.
Sourcepub fn color(self, color: Color) -> Self
pub fn color(self, color: Color) -> Self
Sets a color for drawing. Defaults to white. If a texture is supplied in addtion to the color, each fragment will be computed from texel color * color.
Sourcepub fn texture(self, texture: &'a Texture) -> Self
pub fn texture(self, texture: &'a Texture) -> Self
Sets the texture for drawing. If a color is supplied in addtion to the texture, each fragment will be computed from texel color * color.
Sourcepub fn blendmode(self, blendmode: BlendMode) -> Self
pub fn blendmode(self, blendmode: BlendMode) -> Self
Sets the blendmode used to blend the source with the target.
Sourcepub fn program(self, program: &'a Program) -> Self
pub fn program(self, program: &'a Program) -> Self
Sets the fragment shader program used to draw.
Sourcepub fn model_matrix(self, model_matrix: [[f32; 4]; 4]) -> Self
pub fn model_matrix(self, model_matrix: [[f32; 4]; 4]) -> Self
Sets a model matrix for drawing.
Source§impl<'a> DrawBuilder<'a, DrawBuilderRect>
impl<'a> DrawBuilder<'a, DrawBuilderRect>
The following implementations are only available when drawing with Renderer::rect()
Sourcepub fn view_matrix(self, view_matrix: [[f32; 4]; 4]) -> Self
pub fn view_matrix(self, view_matrix: [[f32; 4]; 4]) -> Self
Sets a view matrix for drawing.
Sourcepub fn view_target(self) -> Self
pub fn view_target(self) -> Self
Uses a view matrix that maps the dimensions of the target to the pixel-size of the target.
This is the default setting. It means that a point, e.g. (12., 34.) is mapped to the pixel (12, 34) on the target.
Sourcepub fn view_display(self) -> Self
pub fn view_display(self) -> Self
Uses a view matrix that maps the dimensions of the display to the pixel-size of the target.
Sourcepub fn view_source(self) -> Self
pub fn view_source(self) -> Self
Uses a view matrix that maps the dimensions of the source to the pixel-size of the target.
Trait Implementations§
Source§impl<'a, T: Clone + 'a> Clone for DrawBuilder<'a, T>
impl<'a, T: Clone + 'a> Clone for DrawBuilder<'a, T>
Source§fn clone(&self) -> DrawBuilder<'a, T>
fn clone(&self) -> DrawBuilder<'a, T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'a, T> Freeze for DrawBuilder<'a, T>
impl<'a, T> !RefUnwindSafe for DrawBuilder<'a, T>
impl<'a, T> !Send for DrawBuilder<'a, T>
impl<'a, T> !Sync for DrawBuilder<'a, T>
impl<'a, T> Unpin for DrawBuilder<'a, T>
impl<'a, T> !UnwindSafe for DrawBuilder<'a, T>
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more