pub trait PainterExt {
// Required methods
fn blur_rect(&self, rect: Rect, blur_radius: f32, color: Color32);
fn glow_rect(
&self,
rect: Rect,
rounding: CornerRadius,
color: Color32,
intensity: f32,
);
fn shadow(
&self,
rect: Rect,
rounding: CornerRadius,
offset: Vec2,
blur_radius: f32,
color: Color32,
);
fn dashed_line(
&self,
points: &[Pos2],
stroke: Stroke,
dash_length: f32,
gap_length: f32,
);
fn dotted_line(
&self,
points: &[Pos2],
color: Color32,
dot_radius: f32,
spacing: f32,
);
fn gradient_rect_horizontal(
&self,
rect: Rect,
rounding: CornerRadius,
from: Color32,
to: Color32,
);
fn radial_glow(
&self,
center: Pos2,
radius: f32,
color: Color32,
falloff: f32,
);
}Expand description
Extension trait for egui’s Painter with advanced effects
Required Methods§
Sourcefn blur_rect(&self, rect: Rect, blur_radius: f32, color: Color32)
fn blur_rect(&self, rect: Rect, blur_radius: f32, color: Color32)
Draw a blurred rectangle using layered alpha
Approximates blur by drawing multiple expanding rectangles with decreasing opacity
Sourcefn glow_rect(
&self,
rect: Rect,
rounding: CornerRadius,
color: Color32,
intensity: f32,
)
fn glow_rect( &self, rect: Rect, rounding: CornerRadius, color: Color32, intensity: f32, )
Draw a glow effect around a rectangle
Creates a soft glow by drawing multiple expanding outlines
Sourcefn shadow(
&self,
rect: Rect,
rounding: CornerRadius,
offset: Vec2,
blur_radius: f32,
color: Color32,
)
fn shadow( &self, rect: Rect, rounding: CornerRadius, offset: Vec2, blur_radius: f32, color: Color32, )
Draw a shadow with blur
Renders a blurred shadow offset from the original rectangle
Sourcefn dashed_line(
&self,
points: &[Pos2],
stroke: Stroke,
dash_length: f32,
gap_length: f32,
)
fn dashed_line( &self, points: &[Pos2], stroke: Stroke, dash_length: f32, gap_length: f32, )
Draw a dashed line
Creates a line with alternating dashes and gaps
Sourcefn dotted_line(
&self,
points: &[Pos2],
color: Color32,
dot_radius: f32,
spacing: f32,
)
fn dotted_line( &self, points: &[Pos2], color: Color32, dot_radius: f32, spacing: f32, )
Draw a dotted line
Creates a line with dots at regular intervals
Sourcefn gradient_rect_horizontal(
&self,
rect: Rect,
rounding: CornerRadius,
from: Color32,
to: Color32,
)
fn gradient_rect_horizontal( &self, rect: Rect, rounding: CornerRadius, from: Color32, to: Color32, )
Draw a gradient-filled rectangle
Uses mesh rendering for smooth gradients