[−][src]Struct a2d::Graphics2D
Implementations
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>
[src]
&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
impl !RefUnwindSafe for Graphics2D
impl !Send for Graphics2D
impl !Sync for Graphics2D
impl Unpin for Graphics2D
impl !UnwindSafe for Graphics2D
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,