pub struct Surface { /* private fields */ }Implementations§
Source§impl Surface
impl Surface
pub fn from_canvas(element_id: &str) -> Surface
pub fn from_size(width: usize, height: usize) -> Surface
pub fn from_image(image_url: &str) -> Surface
pub fn loaded(&self) -> bool
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn get_pixel(&self, x: usize, y: usize) -> [u8; 4]
pub fn resize(&self, width: usize, height: usize) -> Surface
pub fn draw_surface( &self, src: &Surface, alpha: u8, x: f32, y: f32, w: f32, h: f32, )
pub fn draw_surface_rotated( &self, src: &Surface, alpha: u8, x: f32, y: f32, w: f32, h: f32, rot_x: f32, rot_y: f32, rot_angle: f32, )
pub fn draw_subsurface( &self, src: &Surface, alpha: u8, src_x: usize, src_y: usize, src_w: usize, src_h: usize, x: f32, y: f32, w: f32, h: f32, )
pub fn draw_subsurface_rotated( &self, src: &Surface, alpha: u8, src_x: usize, src_y: usize, src_w: usize, src_h: usize, x: f32, y: f32, w: f32, h: f32, rot_x: f32, rot_y: f32, rot_angle: f32, )
pub fn draw_rect( &self, red: u8, green: u8, blue: u8, alpha: u8, x: f32, y: f32, w: f32, h: f32, )
pub fn draw_rect_rotated( &self, red: u8, green: u8, blue: u8, alpha: u8, x: f32, y: f32, w: f32, h: f32, rot_x: f32, rot_y: f32, rot_angle: f32, )
pub fn clear_rect(&self, x: f32, y: f32, w: f32, h: f32)
pub fn clear_rect_rotated( &self, x: f32, y: f32, w: f32, h: f32, rot_x: f32, rot_y: f32, rot_angle: f32, )
pub fn draw_oval( &self, red: u8, green: u8, blue: u8, alpha: u8, x: f32, y: f32, w: f32, h: f32, )
pub fn draw_oval_rotated( &self, red: u8, green: u8, blue: u8, alpha: u8, x: f32, y: f32, w: f32, h: f32, rot_x: f32, rot_y: f32, rot_angle: f32, )
pub fn clear_oval(&self, x: f32, y: f32, w: f32, h: f32)
pub fn clear_oval_rotated( &self, x: f32, y: f32, w: f32, h: f32, rot_x: f32, rot_y: f32, rot_angle: f32, )
pub fn draw_line( &self, red: u8, green: u8, blue: u8, alpha: u8, x1: f32, y1: f32, x2: f32, y2: f32, w: f32, )
pub fn clear_line(&self, x1: f32, y1: f32, x2: f32, y2: f32, w: f32)
pub fn draw_quadratic_bezier( &self, red: u8, green: u8, blue: u8, alpha: u8, x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, w: f32, )
pub fn clear_quadratic_bezier( &self, x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, w: f32, )
pub fn draw_cubic_bezier( &self, red: u8, green: u8, blue: u8, alpha: u8, x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, x4: f32, y4: f32, w: f32, )
pub fn clear_cubic_bezier( &self, x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, x4: f32, y4: f32, w: f32, )
pub fn draw_text( &self, text: &str, font: &str, red: u8, green: u8, blue: u8, alpha: u8, x: f32, y: f32, align: TextAlign, h: f32, )
pub fn clear_text( &self, text: &str, font: &str, x: f32, y: f32, align: TextAlign, h: f32, )
pub fn draw_text_rotated( &self, text: &str, font: &str, red: u8, green: u8, blue: u8, alpha: u8, x: f32, y: f32, align: TextAlign, h: f32, rot_x: f32, rot_y: f32, rot_angle: f32, )
pub fn clear_text_rotated( &self, text: &str, font: &str, x: f32, y: f32, align: TextAlign, h: f32, rot_x: f32, rot_y: f32, rot_angle: f32, )
pub fn fill(&self, red: u8, green: u8, blue: u8, alpha: u8)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Surface
impl RefUnwindSafe for Surface
impl Send for Surface
impl Sync for Surface
impl Unpin for Surface
impl UnwindSafe for Surface
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more