pub struct Renderer { /* private fields */ }
Expand description

The handle used for rendering all objects

Implementations§

source§

impl Renderer

source

pub fn draw_rectangle( &mut self, position: Vec2<f32>, width: f32, hieght: f32, colour: Colour )

draws a textureless rectangle with a specificed colour

source

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.

source

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

source

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.

source

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})
source

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

source

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

source

pub fn draw_text( &mut self, text: &str, position: Vec2<f32>, scale: f32, colour: Colour )

Draws some text that will appear on top of all other elements due to seperate pipelines

source

pub fn draw_text_with_transform( &mut self, text: &str, position: Vec2<f32>, scale: f32, colour: Colour, transform: [f32; 16] )

Draws text with custom transform matrix

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V