Struct bottomless_pit::render::Renderer
source · pub struct Renderer { /* private fields */ }Expand description
The handle used for rendering all objects
Implementations§
source§impl Renderer
impl Renderer
sourcepub fn draw_rectangle(
&mut self,
position: Vec2<f32>,
width: f32,
hieght: f32,
colour: Colour
)
pub fn draw_rectangle( &mut self, position: Vec2<f32>, width: f32, hieght: f32, colour: Colour )
draws a textureless rectangle with a specificed colour
sourcepub fn draw_screenspace_rectangle(
&mut self,
position: Vec2<f32>,
width: f32,
hieght: f32,
colour: Colour
)
pub fn draw_screenspace_rectangle( &mut self, position: Vec2<f32>, width: f32, hieght: f32, colour: Colour )
Draws a rectangle in WGSL screenspace. point(-1.0, -1.0) is the bottom left corner and (0.0,0.0) is the center of the screen.
sourcepub fn draw_textured_rectangle(
&mut self,
position: Vec2<f32>,
width: f32,
hieght: f32,
texture: &TextureIndex
)
pub fn draw_textured_rectangle( &mut self, position: Vec2<f32>, width: f32, hieght: f32, texture: &TextureIndex )
draws a textured rectangle, however it will draw the entire texture
sourcepub fn draw_textured_screenspace_rectangle(
&mut self,
position: Vec2<f32>,
width: f32,
hieght: f32,
texture: &TextureIndex
)
pub fn draw_textured_screenspace_rectangle( &mut self, position: Vec2<f32>, width: f32, hieght: f32, texture: &TextureIndex )
Draws a textured rectangle in WGSL screenspace. point(-1.0, -1.0) is the bottom left corner and (0.0,0.0) is the center of the screen.
sourcepub fn draw_textured_rectangle_with_uv(
&mut self,
position: Vec2<f32>,
width: f32,
hieght: f32,
texture: &TextureIndex,
uv_position: Vec2<f32>,
uv_size: Vec2<f32>
)
pub fn draw_textured_rectangle_with_uv( &mut self, position: Vec2<f32>, width: f32, hieght: f32, texture: &TextureIndex, uv_position: Vec2<f32>, uv_size: Vec2<f32> )
draws a textured rectangle with the specifed UV coords. The image coords are not relative terms but the pixels of the image. uv_position is the top left corner for the uv rectangle to start, then the width and the height are just the width and the height of the uv rectangle.
renderer.draw_textured_rectangle_with_uv(position, 100.0, 100.0, texture, Vec2{x: 0.0, y: 0.0}, Vec2{x: 100.0, y: 100.0})sourcepub fn draw_regular_n_gon(
&mut self,
number_of_sides: u16,
radius: f32,
center: Vec2<f32>,
colour: Colour
)
pub fn draw_regular_n_gon( &mut self, number_of_sides: u16, radius: f32, center: Vec2<f32>, colour: Colour )
draws a regular polygon of any number of sides
sourcepub fn draw_line(
&mut self,
start_point: Vec2<f32>,
end_point: Vec2<f32>,
colour: Colour
)
pub fn draw_line( &mut self, start_point: Vec2<f32>, end_point: Vec2<f32>, colour: Colour )
draws a line, WILL DRAW ONTOP OF EVERTHING ELSE DUE TO BEING ITS OWN PIPELINE