pub struct SpriteVisual { /* private fields */ }Expand description
Visual that paints its bounds with a Brush and can host child visuals.
Implementations§
Methods from Deref<Target = ContainerVisual>§
Sourcepub fn children(&self) -> VisualCollection
pub fn children(&self) -> VisualCollection
Returns the collection of child visuals.
Methods from Deref<Target = Visual>§
Sourcepub fn set_offset(&self, x: f32, y: f32, z: f32)
pub fn set_offset(&self, x: f32, y: f32, z: f32)
Sets the visual’s offset from its parent, in DIPs.
Sourcepub fn set_opacity(&self, opacity: f32)
pub fn set_opacity(&self, opacity: f32)
Sets the visual’s opacity in the range 0.0..=1.0.
Sourcepub fn set_visible(&self, visible: bool)
pub fn set_visible(&self, visible: bool)
Sets whether the visual (and its subtree) is rendered.
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Returns whether the visual is visible.
Sourcepub fn set_scale(&self, scale: Vector3)
pub fn set_scale(&self, scale: Vector3)
Sets the visual’s scale factor about its center point.
Sourcepub fn set_center_point(&self, point: Vector3)
pub fn set_center_point(&self, point: Vector3)
Sets the point, in DIPs, about which rotation and scaling are applied.
Sourcepub fn set_anchor_point(&self, point: Vector2)
pub fn set_anchor_point(&self, point: Vector2)
Sets the normalized anchor point (0.0..=1.0 per axis) that the visual’s
offset positions.
Sourcepub fn set_border_mode(&self, mode: BorderMode)
pub fn set_border_mode(&self, mode: BorderMode)
Sets how the visual’s edges are rendered.
Sourcepub fn parent(&self) -> Option<ContainerVisual>
pub fn parent(&self) -> Option<ContainerVisual>
Returns the visual’s parent container, if it has one.
Sourcepub fn set_relative_size_adjustment(&self, adjustment: Vector2)
pub fn set_relative_size_adjustment(&self, adjustment: Vector2)
Sets the visual’s size as a fraction of its parent’s size (per axis).
Sourcepub fn set_relative_offset_adjustment(&self, adjustment: Vector3)
pub fn set_relative_offset_adjustment(&self, adjustment: Vector3)
Sets an offset expressed as a fraction of the parent’s size (per axis).
Sourcepub fn set_parent_for_transform(&self, parent: &Self)
pub fn set_parent_for_transform(&self, parent: &Self)
Sets the visual whose coordinate space this visual’s transform is relative to.
Sourcepub fn compositor(&self) -> Compositor
pub fn compositor(&self) -> Compositor
Returns the compositor that created this visual.
Sourcepub fn start_animation(&self, property: &str, animation: &impl Animation)
pub fn start_animation(&self, property: &str, animation: &impl Animation)
Starts an animation on the named property (for example "Scale").
Sourcepub fn set_implicit_animations(
&self,
animations: Option<&ImplicitAnimationCollection>,
)
pub fn set_implicit_animations( &self, animations: Option<&ImplicitAnimationCollection>, )
Attaches (or, with None, clears) the ImplicitAnimationCollection
that animates this visual’s properties automatically when they change.
Trait Implementations§
Source§impl Clone for SpriteVisual
impl Clone for SpriteVisual
Source§fn clone(&self) -> SpriteVisual
fn clone(&self) -> SpriteVisual
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more