FIXED
This commit is contained in:
parent
3723dc1966
commit
68b82fe1e0
12
src/lib.rs
12
src/lib.rs
|
@ -84,7 +84,7 @@
|
|||
//! ```
|
||||
|
||||
pub mod physics;
|
||||
pub mod vec;
|
||||
pub mod vec2;
|
||||
|
||||
use std::{
|
||||
cell::Cell,
|
||||
|
@ -188,7 +188,7 @@ pub struct Sprite {
|
|||
pub rect: Rect,
|
||||
surf: Surface<'static>,
|
||||
angle: f64,
|
||||
is_platform: bool,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -200,7 +200,7 @@ impl Sprite {
|
|||
/// # use cat_box::*;
|
||||
/// let s = Sprite::new("duck.png", 500, 400).unwrap();
|
||||
/// ```
|
||||
pub fn new<P: AsRef<Path>>(path: P, x: i32, y: i32, plat: bool) -> Result<Self> {
|
||||
pub fn new<P: AsRef<Path>>(path: P, x: i32, y: i32) -> Result<Self> {
|
||||
let ops = RWops::from_file(path, "r")?;
|
||||
let surf = ops.load()?;
|
||||
|
||||
|
@ -211,7 +211,7 @@ impl Sprite {
|
|||
rect: dest_rect,
|
||||
surf,
|
||||
angle: 0.0,
|
||||
is_platform: plat,
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ impl Sprite {
|
|||
/// let bytes = include_bytes!("../duck.png");
|
||||
/// let s = Sprite::from_bytes(bytes, 500, 400).unwrap();
|
||||
/// ```
|
||||
pub fn from_bytes<B: AsRef<[u8]>>(bytes: B, x: i32, y: i32, plat: bool) -> Result<Self> {
|
||||
pub fn from_bytes<B: AsRef<[u8]>>(bytes: B, x: i32, y: i32) -> Result<Self> {
|
||||
let ops = RWops::from_bytes(bytes.as_ref())?;
|
||||
let surf = ops.load()?;
|
||||
|
||||
|
@ -234,7 +234,7 @@ impl Sprite {
|
|||
rect: dest_rect,
|
||||
surf,
|
||||
angle: 0.0,
|
||||
is_platform: plat,
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue