pub struct ElectricBorder {
pub width: f32,
pub height: f32,
pub border_radius: f32,
pub speed: f32,
pub chaos: f32,
/* private fields */
}Expand description
Electric border animator
Generates displaced points along a rounded rectangle border path, creating an animated electric effect using noise displacement.
Fields§
§width: f32Border width in pixels
height: f32Border height in pixels
border_radius: f32Border radius for rounded corners (pixels)
speed: f32Animation speed multiplier (1.0 = normal)
chaos: f32Chaos level - displacement amplitude (0.0 = none, 0.2 = high)
Implementations§
Source§impl ElectricBorder
impl ElectricBorder
Sourcepub fn with_radius(self, radius: f32) -> Self
pub fn with_radius(self, radius: f32) -> Self
Set border radius
Sourcepub fn with_speed(self, speed: f32) -> Self
pub fn with_speed(self, speed: f32) -> Self
Set animation speed
Sourcepub fn with_chaos(self, chaos: f32) -> Self
pub fn with_chaos(self, chaos: f32) -> Self
Set chaos level (displacement amount)
Sourcepub fn set_dimensions(&mut self, width: f32, height: f32)
pub fn set_dimensions(&mut self, width: f32, height: f32)
Update dimensions
Sourcepub fn generate_points(&self) -> Vec<(f32, f32)>
pub fn generate_points(&self) -> Vec<(f32, f32)>
Generate displaced border points
Returns a vector of (x, y) coordinates along the border path with noise-based displacement applied.
Sourcepub fn sample_count(&self) -> usize
pub fn sample_count(&self) -> usize
Get number of sample points
Trait Implementations§
Source§impl Clone for ElectricBorder
impl Clone for ElectricBorder
Source§fn clone(&self) -> ElectricBorder
fn clone(&self) -> ElectricBorder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ElectricBorder
impl Debug for ElectricBorder
Auto Trait Implementations§
impl Freeze for ElectricBorder
impl RefUnwindSafe for ElectricBorder
impl Send for ElectricBorder
impl Sync for ElectricBorder
impl Unpin for ElectricBorder
impl UnsafeUnpin for ElectricBorder
impl UnwindSafe for ElectricBorder
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