All Projects → tversteeg → Blit

tversteeg / Blit

Licence: gpl-3.0
👾 Blitting library for 2D sprites

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Blit

NextGenSprites
Some sweet sprite shaders for Unity
Stars: ✭ 26 (+73.33%)
Mutual labels:  gamedev, sprites
Pixelorama
A free & open-source 2D sprite editor, made with the Godot Engine! Available on Windows, Linux, macOS and the Web!
Stars: ✭ 2,535 (+16800%)
Mutual labels:  gamedev, sprites
Mq Sprite
A sprite editor.
Stars: ✭ 65 (+333.33%)
Mutual labels:  gamedev, sprites
faur
⚒️✨ My personal C games framework. 2D graphics, sound, inputs, states, ECS, and misc utils for data, files, math, memory, strings, time, and more. Builds for Linux, Windows, Web, and embedded devices.
Stars: ✭ 55 (+266.67%)
Mutual labels:  gamedev, 2d-graphics
SimpleTilemap
A fast, easy way to generate runtime tilemaps in Unity
Stars: ✭ 37 (+146.67%)
Mutual labels:  gamedev, 2d-graphics
BonEngineSharp
A simple and fun SDL-based game engine in C#.
Stars: ✭ 16 (+6.67%)
Mutual labels:  gamedev, sprites
Deadsimple Pixel Perfect Camera
An exceedingly easy-to-use pixel perfect orthographic camera script for 2D scenes in Unity. Punch in a few specs and you've got a working pixel perfect camera. It's that easy.
Stars: ✭ 186 (+1140%)
Mutual labels:  gamedev, sprites
tuile
Tuile (french for tile) is a 2D graphics engine inspired from old hardware and based on layers, tiles sets, tile maps and sprites. Its scanline rendering pipeline makes it perfect for raster effects.
Stars: ✭ 19 (+26.67%)
Mutual labels:  gamedev, sprites
Pixelvision8
Pixel Vision 8's core philosophy is to teach retro game development with streamlined workflows. PV8 is also a platform that standardizes 8-bit fantasy console limitations built on top of the open-source C# game engine based on MonoGame.
Stars: ✭ 773 (+5053.33%)
Mutual labels:  gamedev, sprites
Excalibur
🎮 An easy to use 2D HTML5 game engine written in TypeScript
Stars: ✭ 892 (+5846.67%)
Mutual labels:  gamedev
Librg
🚀 Making multi-player gamedev simpler since 2017
Stars: ✭ 813 (+5320%)
Mutual labels:  gamedev
Ct Js
Ct.js is a desktop game engine that makes learning programming fun and game development easy by its visual editors and well-documented code library
Stars: ✭ 831 (+5440%)
Mutual labels:  gamedev
Feather
A Minecraft server implementation in Rust
Stars: ✭ 896 (+5873.33%)
Mutual labels:  gamedev
Cr
cr.h: A Simple C Hot Reload Header-only Library
Stars: ✭ 845 (+5533.33%)
Mutual labels:  gamedev
Awesome Gideros
A curated list of awesome Gideros resources, classes and tips.
Stars: ✭ 17 (+13.33%)
Mutual labels:  gamedev
Werender
Simple, light-weight, Canvas library for 2D rendering
Stars: ✭ 13 (-13.33%)
Mutual labels:  2d-graphics
2d Spaceshooter
A very simple 2D space shooter game made with Unity
Stars: ✭ 6 (-60%)
Mutual labels:  2d-graphics
Utymap
Highly customizable library for procedural world generation based on real map data
Stars: ✭ 825 (+5400%)
Mutual labels:  gamedev
Beaverandfairies
Stars: ✭ 14 (-6.67%)
Mutual labels:  gamedev
Blend2d
2D Vector Graphics Engine Powered by a JIT Compiler
Stars: ✭ 859 (+5626.67%)
Mutual labels:  2d-graphics

blit

A Rust library for blitting 2D sprites

CI Cargo License: GPL-3.0 Downloads

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

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 the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].