[][src]Trait polystrip::geometry::FrameGeometryExt

pub trait FrameGeometryExt<'a> {
    fn draw_rect(&mut self, bounds: Rect, color: Color);
fn draw_texture(&mut self, x: i32, y: i32, texture: &'a Texture);
fn draw_texture_scaled(&mut self, destination: Rect, texture: &'a Texture);
fn draw_texture_cropped(
        &mut self,
        source: Rect,
        x: i32,
        y: i32,
        texture: &'a Texture
    );
fn draw_texture_cropped_scaled(
        &mut self,
        source: Rect,
        destination: Rect,
        texture: &'a Texture
    ); }

This trait contains numerous functions to make rendering to a Frame easier.

Required methods

fn draw_rect(&mut self, bounds: Rect, color: Color)

Draw and fill a Rect with the specified Color.

fn draw_texture(&mut self, x: i32, y: i32, texture: &'a Texture)

Draw a rectangular texture at a 1:1 scale at the specified coordinates.

fn draw_texture_scaled(&mut self, destination: Rect, texture: &'a Texture)

Draw a rectangular texture to fit the specified Rect

fn draw_texture_cropped(
    &mut self,
    source: Rect,
    x: i32,
    y: i32,
    texture: &'a Texture
)

Draw a rectangular section of a texture at a 1:1 scale at the specified coordinates.

Arguments

  • source: The section of the texture to draw. Sampling beyond the bounds of the texture will result in the texture being repeated
  • x, y: The coordinates of the top-left corner of the destination.
  • texture: A reference to the texture to be drawn

fn draw_texture_cropped_scaled(
    &mut self,
    source: Rect,
    destination: Rect,
    texture: &'a Texture
)

Draw a rectangular section of a texture to fit the specified destination Rect.

Arguments

  • source: The section of the texture to draw. Sampling beyond the bounds of the texture will result in the texture being repeated
  • destination: The position and size at which to draw the texture
  • texture: The texture to be drawn
Loading content...

Implementors

impl<'a> FrameGeometryExt<'a> for Frame<'a>[src]

Loading content...