FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SpotLight

    struct · ferroui-base · v0.5.0

    struct SpotLight
    

    A light from a point into a cone (WinUI Microsoft.UI.Composition.SpotLight): a point light whose light is the inner cone colour inside the inner cone, falls off to the outer cone colour and to nothing at the edge of the outer cone, and is nothing outside it. The cone angles are measured from the direction to the edge of the cone, in radians. Every member but CoordinateSpace is animatable.

    Deviation (winui-composition.md): InnerConeAngleInDegrees and OuterConeAngleInDegrees are views of the radians and cannot be the target of an animation.

    View source

    Members

    from_light

    fn from_light(light: &Rc<CompositionLight>) -> Option<SpotLight>
    

    The handle of light as this class, if it is one.

    Source

    constant_attenuation

    fn constant_attenuation(self: &Self) -> f32
    

    The constant term of the attenuation (default 1).

    Source

    set_constant_attenuation

    fn set_constant_attenuation(self: &Self, value: f32)
    

    Source

    linear_attenuation

    fn linear_attenuation(self: &Self) -> f32
    

    The term of the attenuation proportional to the distance (default 0).

    Source

    set_linear_attenuation

    fn set_linear_attenuation(self: &Self, value: f32)
    

    Source

    quadratic_attenuation

    fn quadratic_attenuation(self: &Self) -> f32
    

    The term of the attenuation proportional to the square of the distance (default 0).

    Source

    set_quadratic_attenuation

    fn set_quadratic_attenuation(self: &Self, value: f32)
    

    Source

    coordinate_space

    fn coordinate_space(self: &Self) -> Option<Rc<CompositionVisual>>
    

    The visual whose coordinates Offset and Direction are in; None for the targeted visual.

    Source

    set_coordinate_space

    fn set_coordinate_space(self: &Self, value: Option<Rc<CompositionVisual>>)
    

    Source

    direction

    fn direction(self: &Self) -> Vector3D
    

    The direction the light shines in (default (0, 0, -1)).

    Source

    set_direction

    fn set_direction(self: &Self, value: Vector3D)
    

    Source

    inner_cone_angle

    fn inner_cone_angle(self: &Self) -> f32
    

    The angle from the direction to the edge of the inner cone, in radians (default 0).

    Source

    set_inner_cone_angle

    fn set_inner_cone_angle(self: &Self, value: f32)
    

    Source

    inner_cone_angle_in_degrees

    fn inner_cone_angle_in_degrees(self: &Self) -> f32
    

    The inner cone angle in degrees: a view of inner_cone_angle.

    Source

    set_inner_cone_angle_in_degrees

    fn set_inner_cone_angle_in_degrees(self: &Self, value: f32)
    

    Source

    inner_cone_color

    fn inner_cone_color(self: &Self) -> Color
    

    The colour of the light inside the inner cone (default white).

    Source

    set_inner_cone_color

    fn set_inner_cone_color(self: &Self, value: Color)
    

    Source

    inner_cone_intensity

    fn inner_cone_intensity(self: &Self) -> f32
    

    The intensity of the light inside the inner cone (default 1).

    Source

    set_inner_cone_intensity

    fn set_inner_cone_intensity(self: &Self, value: f32)
    

    Source

    outer_cone_angle

    fn outer_cone_angle(self: &Self) -> f32
    

    The angle from the direction to the edge of the outer cone, in radians (default pi / 4).

    Source

    set_outer_cone_angle

    fn set_outer_cone_angle(self: &Self, value: f32)
    

    Source

    outer_cone_angle_in_degrees

    fn outer_cone_angle_in_degrees(self: &Self) -> f32
    

    The outer cone angle in degrees: a view of outer_cone_angle.

    Source

    set_outer_cone_angle_in_degrees

    fn set_outer_cone_angle_in_degrees(self: &Self, value: f32)
    

    Source

    outer_cone_color

    fn outer_cone_color(self: &Self) -> Color
    

    The colour of the light between the inner and the outer cone (default white).

    Source

    set_outer_cone_color

    fn set_outer_cone_color(self: &Self, value: Color)
    

    Source

    outer_cone_intensity

    fn outer_cone_intensity(self: &Self) -> f32
    

    The intensity of the light between the inner and the outer cone (default 1).

    Source

    set_outer_cone_intensity

    fn set_outer_cone_intensity(self: &Self, value: f32)
    

    Source

    offset

    fn offset(self: &Self) -> Vector3D
    

    The position of the light in its coordinate space; Z is the height above the visuals.

    Source

    set_offset

    fn set_offset(self: &Self, value: Vector3D)
    

    Source

    min_attenuation_cutoff

    fn min_attenuation_cutoff(self: &Self) -> f32
    

    The distance up to which the light is not attenuated (default 0).

    Source

    set_min_attenuation_cutoff

    fn set_min_attenuation_cutoff(self: &Self, value: f32)
    

    Source

    max_attenuation_cutoff

    fn max_attenuation_cutoff(self: &Self) -> f32
    

    The distance beyond which the light lights nothing (default f32::MAX).

    Source

    set_max_attenuation_cutoff

    fn set_max_attenuation_cutoff(self: &Self, value: f32)
    

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Receiver
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Deref

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.