blit alternatives and similar packages
Based on the "Game development" category.
Alternatively, view blit alternatives based on common mentions on social networks and blogs.
-
RG3D
DISCONTINUED. 3D and 2D game engine written in Rust [Moved to: https://github.com/FyroxEngine/Fyrox]
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of blit or a related project?
Popular Comparisons
README
blit
A Rust library for blitting 2D sprites
Documentation
Usage
Add this to your Cargo.toml
:
[dependencies]
blit = "0.5"
And this to your crate root:
extern crate blit;
Run the example
On Linux you need the xorg-dev
package as required by minifb
. sudo apt install xorg-dev
cargo run --example smiley
This should produce the following window:
[Example](img/example.png?raw=true)
Examples
extern crate image;
use blit::*;
const WIDTH: usize = 180;
const HEIGHT: usize = 180;
const MASK_COLOR: u32 = 0xFF00FF;
let mut buffer: Vec<u32> = vec![0xFFFFFFFF; WIDTH * HEIGHT];
let img = image::open("examples/smiley.png").unwrap();
let img_rgb = img.as_rgb8().unwrap();
// Blit directly to the buffer
let pos = (0, 0);
img_rgb.blit(&mut buffer, WIDTH, pos, Color::from_u32(MASK_COLOR));
// Blit by creating a special blitting buffer first, this has some initial
// overhead but is a lot faster after multiple calls
let blit_buffer = img_rgb.to_blit_buffer(Color::from_u32(MASK_COLOR));
let pos = (10, 10);
blit_buffer.blit(&mut buffer, WIDTH, pos);
let pos = (20, 20);
blit_buffer.blit(&mut buffer, WIDTH, pos);
// Save the blit buffer to a file
blit_buffer.save("smiley.blit");
*Note that all licence references and agreements mentioned in the blit README section above
are relevant to that project's source code only.