pub struct SpotLight(/* private fields */);Expand description
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.
Implementations§
Source§impl SpotLight
impl SpotLight
Sourcepub fn from_light(light: &Rc<CompositionLight>) -> Option<SpotLight>
pub fn from_light(light: &Rc<CompositionLight>) -> Option<SpotLight>
The handle of light as this class, if it is one.
Sourcepub fn props(&self) -> &SpotLightProps
pub fn props(&self) -> &SpotLightProps
The generated properties of the class.
Source§impl SpotLight
impl SpotLight
Sourcepub fn constant_attenuation(&self) -> f32
pub fn constant_attenuation(&self) -> f32
The constant term of the attenuation (default 1).
pub fn set_constant_attenuation(&self, value: f32)
Sourcepub fn linear_attenuation(&self) -> f32
pub fn linear_attenuation(&self) -> f32
The term of the attenuation proportional to the distance (default 0).
pub fn set_linear_attenuation(&self, value: f32)
Sourcepub fn quadratic_attenuation(&self) -> f32
pub fn quadratic_attenuation(&self) -> f32
The term of the attenuation proportional to the square of the distance (default 0).
pub fn set_quadratic_attenuation(&self, value: f32)
Sourcepub fn coordinate_space(&self) -> Option<Rc<CompositionVisual>>
pub fn coordinate_space(&self) -> Option<Rc<CompositionVisual>>
The visual whose coordinates Offset and Direction are in; None
for the targeted visual.
pub fn set_coordinate_space(&self, value: Option<Rc<CompositionVisual>>)
pub fn set_direction(&self, value: Vector3D)
Sourcepub fn inner_cone_angle(&self) -> f32
pub fn inner_cone_angle(&self) -> f32
The angle from the direction to the edge of the inner cone, in radians (default 0).
pub fn set_inner_cone_angle(&self, value: f32)
Sourcepub fn inner_cone_angle_in_degrees(&self) -> f32
pub fn inner_cone_angle_in_degrees(&self) -> f32
The inner cone angle in degrees: a view of
inner_cone_angle.
pub fn set_inner_cone_angle_in_degrees(&self, value: f32)
Sourcepub fn inner_cone_color(&self) -> Color
pub fn inner_cone_color(&self) -> Color
The colour of the light inside the inner cone (default white).
pub fn set_inner_cone_color(&self, value: Color)
Sourcepub fn inner_cone_intensity(&self) -> f32
pub fn inner_cone_intensity(&self) -> f32
The intensity of the light inside the inner cone (default 1).
pub fn set_inner_cone_intensity(&self, value: f32)
Sourcepub fn outer_cone_angle(&self) -> f32
pub fn outer_cone_angle(&self) -> f32
The angle from the direction to the edge of the outer cone, in radians (default pi / 4).
pub fn set_outer_cone_angle(&self, value: f32)
Sourcepub fn outer_cone_angle_in_degrees(&self) -> f32
pub fn outer_cone_angle_in_degrees(&self) -> f32
The outer cone angle in degrees: a view of
outer_cone_angle.
pub fn set_outer_cone_angle_in_degrees(&self, value: f32)
Sourcepub fn outer_cone_color(&self) -> Color
pub fn outer_cone_color(&self) -> Color
The colour of the light between the inner and the outer cone (default white).
pub fn set_outer_cone_color(&self, value: Color)
Sourcepub fn outer_cone_intensity(&self) -> f32
pub fn outer_cone_intensity(&self) -> f32
The intensity of the light between the inner and the outer cone (default 1).
pub fn set_outer_cone_intensity(&self, value: f32)
Sourcepub fn offset(&self) -> Vector3D
pub fn offset(&self) -> Vector3D
The position of the light in its coordinate space; Z is the height above the visuals.
pub fn set_offset(&self, value: Vector3D)
Sourcepub fn min_attenuation_cutoff(&self) -> f32
pub fn min_attenuation_cutoff(&self) -> f32
The distance up to which the light is not attenuated (default 0).
pub fn set_min_attenuation_cutoff(&self, value: f32)
Sourcepub fn max_attenuation_cutoff(&self) -> f32
pub fn max_attenuation_cutoff(&self) -> f32
The distance beyond which the light lights nothing (default
f32::MAX).
pub fn set_max_attenuation_cutoff(&self, value: f32)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SpotLight
impl !Send for SpotLight
impl !Sync for SpotLight
impl !UnwindSafe for SpotLight
impl Freeze for SpotLight
impl Unpin for SpotLight
impl UnsafeUnpin for SpotLight
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more