pub struct OpacityLayer { /* private fields */ }Expand description
A composited layer that makes its children partially transparent.
When debugging, setting
debug_disable_opacity_layers to true will
cause this layer to be skipped (directly replaced by its children). This can be helpful to
track down the cause of performance problems.
Try to avoid an OpacityLayer with no children. Remove that layer if possible to save some
tree walks.
Implementations§
Source§impl OpacityLayer
impl OpacityLayer
Sourcepub fn new(app: &mut App) -> Handle<OpacityLayer>
pub fn new(app: &mut App) -> Handle<OpacityLayer>
Creates an opacity layer.
The alpha property must be non-null before the compositing phase of the
pipeline.
Sourcepub fn alpha(self: Handle<Self>, app: &App) -> Option<i32>
pub fn alpha(self: Handle<Self>, app: &App) -> Option<i32>
The amount to multiply into the alpha channel.
The opacity is expressed as an integer from 0 to 255, where 0 is fully transparent and 255 is fully opaque.
The scene must be explicitly recomposited after this property is changed (as described at
Layer).
Trait Implementations§
Source§impl ContainerLayer for OpacityLayer
impl ContainerLayer for OpacityLayer
Source§const AS_OFFSET: Option<fn() -> &'static OffsetLayerVTable>
const AS_OFFSET: Option<fn() -> &'static OffsetLayerVTable>
The offset table when this type
extends OffsetLayer;
container_layer_accessors!(offset) sets it. Dart’s layer is OffsetLayer.Source§fn container_layer_data(self: Handle<Self>, app: &App) -> &ContainerLayerData
fn container_layer_data(self: Handle<Self>, app: &App) -> &ContainerLayerData
Mixin field access.
Source§fn container_layer_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut ContainerLayerData
fn container_layer_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut ContainerLayerData
See
container_layer_data.Source§fn apply_transform(
self: Handle<Self>,
app: &App,
child: Option<AnyLayer>,
transform: &mut Matrix4,
)
fn apply_transform( self: Handle<Self>, app: &App, child: Option<AnyLayer>, transform: &mut Matrix4, )
Applies the transform that would be applied when compositing the given child to the
given matrix. Read more
Source§fn as_container_layer(self: Handle<Self>) -> AnyContainerLayer
fn as_container_layer(self: Handle<Self>) -> AnyContainerLayer
Dart’s implicit upcast of a concrete layer to
ContainerLayer.Source§fn fire_composition_callbacks(
self: Handle<Self>,
app: &mut App,
include_children: bool,
)
fn fire_composition_callbacks( self: Handle<Self>, app: &mut App, include_children: bool, )
ContainerLayer._fireCompositionCallbacks.Source§fn supports_rasterization(self: Handle<Self>, app: &App) -> bool
fn supports_rasterization(self: Handle<Self>, app: &App) -> bool
ContainerLayer.supportsRasterization.Source§fn find_annotations(
self: Handle<Self>,
app: &App,
result: &mut AnnotationSearch,
local_position: Offset,
only_first: bool,
) -> bool
fn find_annotations( self: Handle<Self>, app: &App, result: &mut AnnotationSearch, local_position: Offset, only_first: bool, ) -> bool
ContainerLayer.findAnnotations.Source§fn redepth_children(self: Handle<Self>, app: &mut App)
fn redepth_children(self: Handle<Self>, app: &mut App)
ContainerLayer.redepthChildren.Source§fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)
fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)
ContainerLayer.addToScene.Source§impl Layer for OpacityLayer
impl Layer for OpacityLayer
Source§const AS_CONTAINER: Option<fn() -> &'static ContainerLayerVTable>
const AS_CONTAINER: Option<fn() -> &'static ContainerLayerVTable>
The container table when this type
extends ContainerLayer; layer_accessors!(container)
sets it. Dart’s layer is ContainerLayer.Source§fn layer_data(self: Handle<Self>, app: &App) -> &LayerData
fn layer_data(self: Handle<Self>, app: &App) -> &LayerData
Dart’s base-class fields, held under the field
layer ([layer_accessors!]).Source§fn layer_data_mut(self: Handle<Self>, app: &mut App) -> &mut LayerData
fn layer_data_mut(self: Handle<Self>, app: &mut App) -> &mut LayerData
See
layer_data.Source§fn supports_rasterization(self: Handle<Self>, app: &App) -> bool
fn supports_rasterization(self: Handle<Self>, app: &App) -> bool
Whether or not this layer, or any child layers, can be rasterized with
Scene.toImage. Read moreSource§fn dispose(self: Handle<Self>, app: &mut App)
fn dispose(self: Handle<Self>, app: &mut App)
Clears any retained resources that this layer holds. Read more
Source§fn attach(self: Handle<Self>, app: &mut App, owner: HandleId)
fn attach(self: Handle<Self>, app: &mut App, owner: HandleId)
Mark this layer as attached to the given owner. Read more
Source§fn detach(self: Handle<Self>, app: &mut App)
fn detach(self: Handle<Self>, app: &mut App)
Mark this layer as detached from its owner. Read more
Source§fn redepth_children(self: Handle<Self>, app: &mut App)
fn redepth_children(self: Handle<Self>, app: &mut App)
Adjust the depth of this node’s children, if any. Read more
Source§fn find_annotations(
self: Handle<Self>,
app: &App,
result: &mut AnnotationSearch,
local_position: Offset,
only_first: bool,
) -> bool
fn find_annotations( self: Handle<Self>, app: &App, result: &mut AnnotationSearch, local_position: Offset, only_first: bool, ) -> bool
Search this layer and its subtree for annotations of the searched type at the location
described by
local_position. Read moreSource§fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)
fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)
Override this method to upload this layer to the engine.
Source§fn fire_composition_callbacks(
self: Handle<Self>,
app: &mut App,
include_children: bool,
)
fn fire_composition_callbacks( self: Handle<Self>, app: &mut App, include_children: bool, )
Dart’s
_fireCompositionCallbacks; ContainerLayer recurses into its children.Source§impl OffsetLayerMixin for OpacityLayer
impl OffsetLayerMixin for OpacityLayer
Source§fn offset_layer_data(self: Handle<Self>, app: &App) -> &OffsetLayerData
fn offset_layer_data(self: Handle<Self>, app: &App) -> &OffsetLayerData
Mixin field access.
Source§fn offset_layer_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut OffsetLayerData
fn offset_layer_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut OffsetLayerData
See
offset_layer_data.Source§fn as_offset_layer(self: Handle<Self>) -> AnyOffsetLayer
fn as_offset_layer(self: Handle<Self>) -> AnyOffsetLayer
Dart’s implicit upcast of a concrete layer to
OffsetLayer.Source§fn offset(self: Handle<Self>, app: &App) -> Offset
fn offset(self: Handle<Self>, app: &App) -> Offset
Offset from parent in the parent’s coordinate system.
Source§fn find_annotations(
self: Handle<Self>,
app: &App,
result: &mut AnnotationSearch,
local_position: Offset,
only_first: bool,
) -> bool
fn find_annotations( self: Handle<Self>, app: &App, result: &mut AnnotationSearch, local_position: Offset, only_first: bool, ) -> bool
OffsetLayer.findAnnotations.Source§fn apply_transform(
self: Handle<Self>,
app: &App,
child: Option<AnyLayer>,
transform: &mut Matrix4,
)
fn apply_transform( self: Handle<Self>, app: &App, child: Option<AnyLayer>, transform: &mut Matrix4, )
OffsetLayer.applyTransform.Source§fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)
fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)
OffsetLayer.addToScene.Auto Trait Implementations§
impl !RefUnwindSafe for OpacityLayer
impl !Send for OpacityLayer
impl !Sync for OpacityLayer
impl !UnwindSafe for OpacityLayer
impl Freeze for OpacityLayer
impl Unpin for OpacityLayer
impl UnsafeUnpin for OpacityLayer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more