Materials for sprites in Bevy

Overview

bevy_sprite_material

Materials for sprites in Bevy

workflow

MIT licensed unsafe forbidden Crates.io Docs.rs dependency status

This bevy plugin changes the bevy_sprite implementation using a material.

You might be interested in bevy_ui_material which is a similar plugin for bevy_ui instead of bevy_sprite.

The new Sprite component is identical to bevy_sprite but without the color field.

The new SpriteBundle component bundle replaces the texture field (Handle<Image>) by a material field (Handle<ColorMaterial>)

Objective

The goal of this plugin is to allow seamless edition of sprites texture and color which was removed with bevy 0.6.

This is very useful if you have many sprites and you have, for example, various themes and don't want to query every sprite to change its color.

If you have a dedicated artist, you probably don't use the sprite color tinting field anyway, so the base implementation is perfect for you. This is specifically if you want to "massively update" the sprite color and maybe the texture as well.

Disclaimer

This plugin is very straightforward, and simply plugs itself in the bevy_sprite render pipeline (in the extraction stage). This system might be slower than the base implementation, because of the extra Handle involved.

Also, there might be compatibility issues, so feel free to open issues or merge requests.

This plugin should work fine if you use both the plugin and the base sprite implementation

You might also like...
Basic first-person fly camera for the Bevy game engine

bevy_flycam A basic first-person fly camera for Bevy 0.4 Controls WASD to move horizontally SPACE to ascend LSHIFT to descend ESC to grab/release curs

An ergonomic physics API for bevy games.

Heron An ergonomic physics API for 2d and 3d bevy games. (powered by rapier) How it looks like fn main() { App::build() .add_plugins(DefaultPlug

Inspector plugin for the bevy game engine
Inspector plugin for the bevy game engine

bevy-inspector-egui This crate provides the ability to annotate structs with a #[derive(Inspectable)], which opens a debug interface using egui where

A plugin for Egui integration into Bevy
A plugin for Egui integration into Bevy

bevy_egui This crate provides a Egui integration for the Bevy game engine. Features: Desktop and web (bevy_webgl2) platforms support Clipboard (web su

Crossterm plugin for the bevy game engine
Crossterm plugin for the bevy game engine

What is bevy_crossterm? bevy_crossterm is a Bevy plugin that uses crossterm as a renderer. It provides custom components and events which allow users

A 4X style camera for bevy.

A 4X style camera for bevy. Demo Default Key Bindings: W / A / S / D / Arrow Keys / Mouse Left - Move along the horizontal plane Q / E / Mouse Right -

Game physics in one weekend with bevy

Game Physics in a Weekend (in Rust) This project is an implementation of the Game Physics in a Weekend book using the Rust programming language and th

A Bevy plugin to use Kira for game audio

Bevy Kira audio This bevy plugin is intended to try integrating Kira into Bevy. The end goal would be to replace or update bevy_audio, if Kira turns o

Concise Reference Book for the Bevy Game Engine

Unofficial Bevy Cheat Book Click here to read the book! Concise reference to programming in the Bevy game engine. Covers useful syntax, features, prog

Comments
  • Version update is needed

    Version update is needed

    cargo build
        Updating crates.io index
    error: failed to select a version for `web-sys`.
        ... required by package `wgpu v0.12.0`
        ... which satisfies dependency `wgpu = "^0.12.0"` of package `bevy_render v0.7.0`
        ... which satisfies dependency `bevy_render = "^0.7.0"` of package `bevy_core_pipeline v0.7.0`
        ... which satisfies dependency `bevy_core_pipeline = "^0.7.0"` of package `bevy_sprite v0.7.0`
        ... which satisfies dependency `bevy_sprite = "^0.7"` of package `bevy_sprite_material v0.2.0`
        ... which satisfies dependency `bevy_sprite_material = "^0.2.0"` of package `ant_simulation v0.1.0 (/home/felix/Desktop/workspaces/Rust/ant_simulation)`
    versions that meet the requirements `^0.3.53` are: 0.3.59, 0.3.58, 0.3.57, 0.3.56, 0.3.55, 0.3.54, 0.3.53
    
    the package `wgpu` depends on `web-sys`, with features: `GpuBufferUsage` but `web-sys` does not have these features.
    
    
    all possible versions conflict with previously selected packages.
    
      previously selected package `web-sys v0.3.58`
        ... which satisfies dependency `web-sys = "^0.3.53"` of package `wgpu v0.12.0`
        ... which satisfies dependency `wgpu = "^0.12.0"` of package `bevy_render v0.7.0`
        ... which satisfies dependency `bevy_render = "^0.7.0"` of package `bevy_core_pipeline v0.7.0`
        ... which satisfies dependency `bevy_core_pipeline = "^0.7.0"` of package `bevy_sprite v0.7.0`
        ... which satisfies dependency `bevy_sprite = "^0.7"` of package `bevy_sprite_material v0.2.0`
        ... which satisfies dependency `bevy_sprite_material = "^0.2.0"` of package `ant_simulation v0.1.0 (/home/felix/Desktop/workspaces/Rust/ant_simulation)`
    
    failed to select a version for `web-sys` which could resolve this conflict
    
    opened by FelixSelter 2
Owner
Félix Lescaudey de Maneville
🦀 Rust programmer. 🇫🇷 French.
Félix Lescaudey de Maneville
Explicitly set sprite layers for sprites in Bevy games.

extol_sprite_layer lets you specify the drawing order for sprites in your Bevy game using a separate component rather than via the z-coordinate of you

Ash 5 May 2, 2023
A tool to generate inbetweens for animated sprites, written in godot-rust

Bitmapflow is a tool to help you generate inbetweens for animated sprites. In other words, it makes your animations smoother. It uses optical flow to

null 411 Dec 21, 2022
A Rust library for blitting 2D sprites

blit A Rust library for blitting 2D sprites Documentation Usage Add this to your Cargo.toml:

Thomas Versteeg 23 Dec 6, 2022
🎨 Procedurally generate 2D sprites

sprite (Executable) Run On Linux you need the gtk-rs dependencies to compile: cargo install sprite sprite This should produce the following window: s

Thomas Versteeg 68 Nov 25, 2022
Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.

vx_bevy A voxel engine prototype made using the Bevy game engine. Goals and features Very basic worldgen Animated chunk loading (ala cube world) Optim

Lucas Arriesse 125 Dec 31, 2022
bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy

Bevy Voxel Cone Tracing bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy. Bevy Version

研究社交 208 Dec 27, 2022
A simple extension for `bevy-editor-pls` to support tilemap editing right inside the bevy app.

What is this This is a simple tilemap editor plugin, that hooks right into bevy_editor_pls to work with bevy_ecs_tilemap. It works completely within i

null 3 May 8, 2023
Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.

Portals for Bevy Bevy Simple Portals is a Bevy game engine plugin aimed to create portals. Those portals are (for now) purely visual and can be used t

Sélène Amanita 11 May 28, 2023
Minecraft using Bevy and Bevy-Meshem

minecraft_bevy Minecraft_bevy was built to showcase bevy_meshem. After a week of developing it has: Chunk loading / unloading each chunk's mesh is bei

Adam 7 Oct 4, 2023
A Bevy plugin for loading the LDtk 2D tile map format.

bevy_ldtk ( Tileset from "Cavernas" by Adam Saltsman ) A Bevy plugin for loading LDtk tile maps. Usage use bevy::prelude::*; use bevy_ldtk::*; fn mai

Katharos Technology 23 Jul 4, 2022