Crate bevy_mod_opacity

Source
Expand description

Hierarchical opacity for bevy.

§The Opacity component

When Opacity is inserted to an entity, the entity and all its descendants will be affected by the opacity value. Unlike bevy components like Visibility Opacity does not need to be put on every entity in the tree. Entities with no Opacity ancestor will not not affected by this crate.

§Support for native types

We innately support 2d, 3d and ui, this includes Sprite, TextColor, StandardMaterial, ColorMaterial, Image, BackgroundColor and ForegroundColor.

Additionally you can implement OpacityQuery or derive Opacity to make your own types and materials work with this crate. Combining OpacityQuery with custom QueryData can add support for third party types.

§[FadeIn] and [FadeOut]

These components adds a quick way to add and remove entities from your scenes smoothly. You should add a [FadeIn] during the spawn call and use entity.insert(FadeOut) instead of entity.despawn_recursive()

§FAQ

  • My 3d scene is not fading correctly

Ensure materials are duplicated and unique, since we write to the underlying material directly. Also make sure AlphaMode is set to Blend if applicable.

Structs§

Opacity
Component of opacity of this entity and its children.
OpacityMap
A map of entity to opacity, if not present, the entity does not have an opacity root node. This means the entity is out of the scope of this crate and should not be handled.
OpacityPlugin
Plugin for bevy_mod_opacity that adds support for basic bevy types.

Enums§

OpacitySet
SystemSet of opacity, runs in PostUpdate between transform propagation and visibility calculation.
UiOpacity
Determine whether BorderColor and BackgroundColor are controlled by opacity or should stay transparent.

Traits§

OpacityAsset
An Asset with an opacity value.
OpacityExtension
OpacityMaterialExtension
A MaterialExtension with an opacity value.
OpacityQuery
A QueryData with an opacity value.

Derive Macros§

Opacity
Declare a Component or Asset as affected by opacity.