[−][src]Struct a2d::Graphics2D
Implementations
impl Graphics2D
[src]
pub async fn new<W: HasRawWindowHandle, '_>(
width: u32,
height: u32,
window: &'_ W
) -> Result<Self>
[src]
width: u32,
height: u32,
window: &'_ W
) -> Result<Self>
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, 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]
A2DError: From<E>,
I: TryInto<SpriteSheetId, Error = E>,
D: Into<SpriteSheetDesc<'a>>,
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]
A2DError: From<E>,
A2DError: From<ED>,
I: TryInto<SpriteSheetId, Error = E>,
D: TryInto<SpriteBatchDesc, Error = ED>,
pub fn get_batch_mut<I, E>(&mut self, id: I) -> Result<&mut SpriteBatch> where
A2DError: From<E>,
I: TryInto<SpriteSheetId, Error = E>,
[src]
A2DError: From<E>,
I: TryInto<SpriteSheetId, Error = E>,
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>,