#bevy #ui #material

bevy_ui_material

Plugin to use materials for UI

2 unstable releases

Uses new Rust 2021

0.2.0 Apr 22, 2022
0.1.0 Jan 14, 2022

#395 in Game dev

Download history 22/week @ 2022-01-17 3/week @ 2022-01-24 1/week @ 2022-01-31 1/week @ 2022-02-14 21/week @ 2022-02-28 4/week @ 2022-03-14 3/week @ 2022-03-21 1/week @ 2022-04-04 25/week @ 2022-04-18 11/week @ 2022-04-25 17/week @ 2022-05-02

53 downloads per month

Custom license

12KB
137 lines

bevy_ui_material

Materials for bevy UI Nodes

workflow

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

This bevy plugin changes the bevy_ui implementation using a material.

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

This plugin provides new implementation of the following bundles:

  • NodeBundle
  • ButtonBundle
  • ImageBundle

The new component bundles replaces the color field and the image field (Handle<Image>) by a material field (Handle<ColorMaterial>)

Objective

The goal of this plugin is to allow seamless edition of UI nodes image and color which was removed with bevy 0.6.

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

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

Disclaimer

This plugin is very straightforward, and simply plugs itself in the bevy_ui 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 ui implementation

Dependencies

~23MB
~468K SLoC