[][src]Struct very_simple_2d_core::SimpleCanvas

pub struct SimpleCanvas { /* fields omitted */ }

Allows the user to start drawing shapes. The top left corner is the origin. y grows as you go down. x grows as you go right.

Methods

impl SimpleCanvas[src]

pub fn set_viewport(&mut self, window_dim: FixedAspectVec2, game_width: f32)[src]

pub unsafe fn new(window_dim: FixedAspectVec2) -> SimpleCanvas[src]

pub fn sprites(&mut self) -> SpriteSession[src]

pub fn circles(&mut self) -> CircleSession[src]

pub fn squares(&mut self) -> SquareSession[src]

pub fn rects(&mut self) -> RectSession[src]

pub fn arrows(&mut self, radius: f32) -> ArrowSession[src]

pub fn lines(&mut self, radius: f32) -> LineSession[src]

pub fn texture(
    &mut self,
    file: &str,
    grid_dim: Vec2<u32>
) -> ImageResult<Texture>
[src]

Creates a new texture from the specified file. The fact that we need a mutable reference to this object Ensures that we make the texture in the same thread. The grid dimensions passed are the tile dimensions is the texture is a tile set.

pub fn texturep(
    &mut self,
    file: &str,
    grid_dim_x: u32,
    grid_dim_y: u32
) -> ImageResult<Texture>
[src]

Primitive version of texture

pub fn clear_color(&mut self, back_color: [f32; 3])[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.