pub struct SpotlightCard {
pub width: f32,
pub height: f32,
pub radius: f32,
/* private fields */
}Expand description
Spotlight card state
Tracks cursor position and computes spotlight parameters for rendering.
Fields§
§width: f32Card width in pixels
height: f32Card height in pixels
radius: f32Spotlight radius in pixels
Implementations§
Source§impl SpotlightCard
impl SpotlightCard
Sourcepub fn with_radius(self, radius: f32) -> Self
pub fn with_radius(self, radius: f32) -> Self
Set spotlight radius
Sourcepub fn set_dimensions(&mut self, width: f32, height: f32)
pub fn set_dimensions(&mut self, width: f32, height: f32)
Update card dimensions
Sourcepub fn update_cursor(
&mut self,
cursor_x: f32,
cursor_y: f32,
card_x: f32,
card_y: f32,
)
pub fn update_cursor( &mut self, cursor_x: f32, cursor_y: f32, card_x: f32, card_y: f32, )
Update cursor position
§Arguments
cursor_x- Cursor X position in screen/window coordinatescursor_y- Cursor Y position in screen/window coordinatescard_x- Card X position in screen/window coordinatescard_y- Card Y position in screen/window coordinates
Sourcepub fn set_spotlight_position(&mut self, x: f32, y: f32)
pub fn set_spotlight_position(&mut self, x: f32, y: f32)
Set cursor position directly in card-relative coordinates
Sourcepub fn spotlight_x(&self) -> f32
pub fn spotlight_x(&self) -> f32
Get spotlight X position (card-relative)
Sourcepub fn spotlight_y(&self) -> f32
pub fn spotlight_y(&self) -> f32
Get spotlight Y position (card-relative)
Sourcepub fn spotlight_center(&self) -> (f32, f32)
pub fn spotlight_center(&self) -> (f32, f32)
Get spotlight center as (x, y) tuple
Sourcepub fn deactivate(&mut self)
pub fn deactivate(&mut self)
Deactivate spotlight (e.g., when cursor leaves card)
Sourcepub fn normalized_position(&self) -> (f32, f32)
pub fn normalized_position(&self) -> (f32, f32)
Get normalized spotlight position (0.0 to 1.0)
Trait Implementations§
Source§impl Clone for SpotlightCard
impl Clone for SpotlightCard
Source§fn clone(&self) -> SpotlightCard
fn clone(&self) -> SpotlightCard
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 SpotlightCard
impl Debug for SpotlightCard
Source§impl Default for SpotlightCard
impl Default for SpotlightCard
impl Copy for SpotlightCard
Auto Trait Implementations§
impl Freeze for SpotlightCard
impl RefUnwindSafe for SpotlightCard
impl Send for SpotlightCard
impl Sync for SpotlightCard
impl Unpin for SpotlightCard
impl UnsafeUnpin for SpotlightCard
impl UnwindSafe for SpotlightCard
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