Struct macroquad_canvas_2d::Canvas2D [−][src]
Fields
width: f32
height: f32
Implementations
impl Canvas2D
[src]
pub fn new(width: f32, height: f32) -> Self
[src]
Create a new canvas
pub fn draw_inside_canvas(&self, f: &dyn Fn())
[src]
Draw inside of the canvas
pub fn calculate_size_and_padding(
&self,
target_width: f32,
target_height: f32
) -> (f32, f32, Vec2)
[src]
&self,
target_width: f32,
target_height: f32
) -> (f32, f32, Vec2)
Calculate size and padding of the canvas so it can fit inside of the target and its position is in the center
pub fn calculate_size(&self, target_width: f32, target_height: f32) -> Vec2
[src]
Calculate size of the canvas so it can fit inside of the target
pub fn get_texture(&self) -> &Texture2D
[src]
Get a reference of the canvas texture
Auto Trait Implementations
impl RefUnwindSafe for Canvas2D
impl Send for Canvas2D
impl Sync for Canvas2D
impl Unpin for Canvas2D
impl UnwindSafe for Canvas2D
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,
pub 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, 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.
pub 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>,