Trait TextShadowView

Source
pub trait TextShadowView: View {
    // Required method
    fn text_shadow_node(&mut self) -> &mut TextShadow;

    // Provided methods
    fn text_shadow_offset(self, offset: Vec2) -> Self { ... }
    fn text_shadow_color(self, color: impl Into<Color>) -> Self { ... }
}
Expand description

A trait for views that support text shadow styling.

Provides methods to configure shadow offset and color for text-based views.

Required Methods§

Source

fn text_shadow_node(&mut self) -> &mut TextShadow

Returns a mutable reference to the underlying TextShadow node, which stores shadow-related styling information.

Provided Methods§

Source

fn text_shadow_offset(self, offset: Vec2) -> Self

Sets the offset of the text shadow.

§Arguments
  • offset - A Vec2 specifying the horizontal and vertical offset of the shadow.
§Example
view.text_shadow_offset(Vec2::new(2.0, -2.0));
Source

fn text_shadow_color(self, color: impl Into<Color>) -> Self

Sets the color of the text shadow.

§Arguments
  • color - A color value (e.g., Color::rgba(...)) that defines the shadow’s appearance.
§Example
view.text_shadow_color(Color::BLACK.with_a(0.5));

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§