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.
Members
from_lightconstant_attenuationset_constant_attenuationlinear_attenuationset_linear_attenuationquadratic_attenuationset_quadratic_attenuationcoordinate_spaceset_coordinate_spacedirectionset_directioninner_cone_angleset_inner_cone_angleinner_cone_angle_in_degreesset_inner_cone_angle_in_degreesinner_cone_colorset_inner_cone_colorinner_cone_intensityset_inner_cone_intensityouter_cone_angleset_outer_cone_angleouter_cone_angle_in_degreesset_outer_cone_angle_in_degreesouter_cone_colorset_outer_cone_colorouter_cone_intensityset_outer_cone_intensityoffsetset_offsetmin_attenuation_cutoffset_min_attenuation_cutoffmax_attenuation_cutoffset_max_attenuation_cutoff
from_light
fn from_light(light: &Rc<CompositionLight>) -> Option<SpotLight>
The handle of light as this class, if it is one.
constant_attenuation
fn constant_attenuation(self: &Self) -> f32
The constant term of the attenuation (default 1).
set_constant_attenuation
fn set_constant_attenuation(self: &Self, value: f32)
linear_attenuation
fn linear_attenuation(self: &Self) -> f32
The term of the attenuation proportional to the distance (default 0).
set_linear_attenuation
fn set_linear_attenuation(self: &Self, value: f32)
quadratic_attenuation
fn quadratic_attenuation(self: &Self) -> f32
The term of the attenuation proportional to the square of the distance (default 0).
set_quadratic_attenuation
fn set_quadratic_attenuation(self: &Self, value: f32)
coordinate_space
fn coordinate_space(self: &Self) -> Option<Rc<CompositionVisual>>
The visual whose coordinates Offset and Direction are in; None
for the targeted visual.
set_coordinate_space
fn set_coordinate_space(self: &Self, value: Option<Rc<CompositionVisual>>)
direction
fn direction(self: &Self) -> Vector3D
The direction the light shines in (default (0, 0, -1)).
set_direction
fn set_direction(self: &Self, value: Vector3D)
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).
set_inner_cone_angle
fn set_inner_cone_angle(self: &Self, value: f32)
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.
set_inner_cone_angle_in_degrees
fn set_inner_cone_angle_in_degrees(self: &Self, value: f32)
inner_cone_color
fn inner_cone_color(self: &Self) -> Color
The colour of the light inside the inner cone (default white).
set_inner_cone_color
fn set_inner_cone_color(self: &Self, value: Color)
inner_cone_intensity
fn inner_cone_intensity(self: &Self) -> f32
The intensity of the light inside the inner cone (default 1).
set_inner_cone_intensity
fn set_inner_cone_intensity(self: &Self, value: f32)
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).
set_outer_cone_angle
fn set_outer_cone_angle(self: &Self, value: f32)
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.
set_outer_cone_angle_in_degrees
fn set_outer_cone_angle_in_degrees(self: &Self, value: f32)
outer_cone_color
fn outer_cone_color(self: &Self) -> Color
The colour of the light between the inner and the outer cone (default white).
set_outer_cone_color
fn set_outer_cone_color(self: &Self, value: Color)
outer_cone_intensity
fn outer_cone_intensity(self: &Self) -> f32
The intensity of the light between the inner and the outer cone (default 1).
set_outer_cone_intensity
fn set_outer_cone_intensity(self: &Self, value: f32)
offset
fn offset(self: &Self) -> Vector3D
The position of the light in its coordinate space; Z is the height above the visuals.
set_offset
fn set_offset(self: &Self, value: Vector3D)
min_attenuation_cutoff
fn min_attenuation_cutoff(self: &Self) -> f32
The distance up to which the light is not attenuated (default 0).
set_min_attenuation_cutoff
fn set_min_attenuation_cutoff(self: &Self, value: f32)
max_attenuation_cutoff
fn max_attenuation_cutoff(self: &Self) -> f32
The distance beyond which the light lights nothing (default
f32::MAX).
set_max_attenuation_cutoff
fn set_max_attenuation_cutoff(self: &Self, value: f32)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyToOwnedErasedDestructorIntoEitherCloneDeref
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.