[][src]Struct a2d::Graphics2D

pub struct Graphics2D { /* fields omitted */ }


impl Graphics2D[src]

pub async fn from_winit_window<'_>(window: &'_ Window) -> Result<Self>[src]

pub fn courier_sprite_sheet(&mut self) -> Result<Rc<SpriteSheet>>[src]

pub fn new_text_grid(
    &mut self,
    char_width: f32,
    dim: [u32; 2]
) -> Result<TextGrid>

Creates a new TextGrid instance with the builtin courier font given the width of a character block and [num_rows, num_cols]

pub fn resized(&mut self, new_size: PhysicalSize<u32>)[src]

Call this method to notify A2D that the window has been resized

pub fn scale(&self) -> [f32; 2][src]

By default, the screen coordinates are [0, 0] for the upper-left corner and [1, 1] for the lower-right corner. The coordinates of the lower-right corner may be customized with set_scale. The scale method returns the currently set [max_x, max_y] values for the lower-right corner.

pub fn set_scale(&mut self, new_scale: [f32; 2])[src]

Sets the the scale to set the coordinates of the lower-right corner (the upper-left is always [0, 0]). See the method scale for more info.

pub fn render(&mut self, batches: &[&SpriteBatch])[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

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

impl<T> SetParameter for T

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.