[][src]Struct a2d::Graphics2D

pub struct Graphics2D { /* fields omitted */ }

Implementations

impl Graphics2D[src]

pub async fn new<W: HasRawWindowHandle, '_>(
    width: u32,
    height: u32,
    window: &'_ W
) -> Result<Self>
[src]

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

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, width: u32, height: 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)[src]

pub fn set_sheet<'a, I, E, D>(&mut self, id: I, desc: D) -> Result<()> where
    A2DError: From<E>,
    I: TryInto<SpriteSheetId, Error = E>,
    D: Into<SpriteSheetDesc<'a>>, 
[src]

Creates a new sprite sheet and inserts it at the given slot id

pub fn set_batch<I, E, D, ED>(&mut self, id: I, desc: D) -> Result<()> where
    A2DError: From<E>,
    A2DError: From<ED>,
    I: TryInto<SpriteSheetId, Error = E>,
    D: TryInto<SpriteBatchDesc, Error = ED>, 
[src]

pub fn get_batch_mut<I, E>(&mut self, id: I) -> Result<&mut SpriteBatch> where
    A2DError: From<E>,
    I: TryInto<SpriteSheetId, Error = E>, 
[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.