Starting to do physics

This commit is contained in:
2018-10-03 20:48:00 +02:00
parent 4da27c5777
commit 3e8ae2d496
9 changed files with 319 additions and 78 deletions
+2 -1
View File
@@ -57,12 +57,13 @@ macro_rules! make_textures {
}
make_textures!(
Mario, mario, make_mario_texture, "../../../assets/textures/mario.png",
);
impl TextureManager {
/// Creates a textures from an array of bytes.
fn make_texture_from_bytes(bytes: Vec<u8>) -> SfTexture {
SfTexture::from_memory(&bytes, &IntRect::new(0, 0, 500, 500))
SfTexture::from_memory(&bytes, &IntRect::new(0, 0, 256, 256))
.expect("Failed to create texture")
}
}