pub struct ScreenCircleVisual { /* private fields */ }Expand description
A filled or outline-only circle in logical screen pixels. FrameUpdate may animate center/radius/color even when fixed simulation is paused.
Implementations§
Source§impl ScreenCircleVisual
impl ScreenCircleVisual
Sourcepub const fn draw_order_depth(&self) -> f32
pub const fn draw_order_depth(&self) -> f32
Returns finite within-layer ordering depth, not camera depth.
Sourcepub fn set_draw_order_depth(
&mut self,
depth: f32,
) -> Result<(), ScreenVisualError>
pub fn set_draw_order_depth( &mut self, depth: f32, ) -> Result<(), ScreenVisualError>
Sets within-layer depth atomically; nonfinite values are rejected.
Sourcepub const fn clip(&self) -> ScreenClip
pub const fn clip(&self) -> ScreenClip
Returns the explicit fixed-screen clip.
Sourcepub fn set_clip(&mut self, clip: ScreenClip)
pub fn set_clip(&mut self, clip: ScreenClip)
Sets the clip without changing geometry or ordering.
Sourcepub fn new(
center: LogicalScreenPosition,
radius: f32,
color: Color,
) -> Result<Self, ScreenVisualError>
pub fn new( center: LogicalScreenPosition, radius: f32, color: Color, ) -> Result<Self, ScreenVisualError>
Creates a circle with finite center, positive finite radius, and normalized fill.
Sourcepub const fn center(&self) -> LogicalScreenPosition
pub const fn center(&self) -> LogicalScreenPosition
Returns the logical screen center.
For an outline-only circle this is also the stroke’s center of symmetry.
Sourcepub const fn color(&self) -> Color
pub const fn color(&self) -> Color
Returns the stored fill color (inactive for an outline-only circle).
Sourcepub fn outlined(
center: LogicalScreenPosition,
radius: f32,
width: f32,
color: Color,
) -> Result<Self, ScreenVisualError>
pub fn outlined( center: LogicalScreenPosition, radius: f32, width: f32, color: Color, ) -> Result<Self, ScreenVisualError>
Creates a centered circular outline without a filled disk. Width/radius must be finite and positive; color is normalized linear RGBA.
Sourcepub const fn fill_color(&self) -> Option<Color>
pub const fn fill_color(&self) -> Option<Color>
Returns active fill color, or None for an outline-only circle.
Sourcepub fn set_geometry(
&mut self,
center: LogicalScreenPosition,
radius: f32,
) -> Result<(), ScreenVisualError>
pub fn set_geometry( &mut self, center: LogicalScreenPosition, radius: f32, ) -> Result<(), ScreenVisualError>
Atomically changes center and radius, preserving old values on failure.
Sourcepub fn set_center(
&mut self,
center: LogicalScreenPosition,
) -> Result<(), ScreenVisualError>
pub fn set_center( &mut self, center: LogicalScreenPosition, ) -> Result<(), ScreenVisualError>
Changes only the logical screen center, atomically.
Sourcepub fn set_radius(&mut self, radius: f32) -> Result<(), ScreenVisualError>
pub fn set_radius(&mut self, radius: f32) -> Result<(), ScreenVisualError>
Changes only the logical radius, atomically.
Sourcepub fn set_color(&mut self, color: Color) -> Result<(), ScreenVisualError>
pub fn set_color(&mut self, color: Color) -> Result<(), ScreenVisualError>
Sets and enables normalized fill color; rejection preserves all previous state.
Sourcepub fn set_stroke(
&mut self,
stroke: Option<Stroke>,
) -> Result<(), ScreenVisualError>
pub fn set_stroke( &mut self, stroke: Option<Stroke>, ) -> Result<(), ScreenVisualError>
Sets a positive-width normalized-color outline, or removes it with None. An outline-only circle rejects removal until a fill is enabled.
Sourcepub fn contains_pointer(&self, sample: PointerSample) -> bool
pub fn contains_pointer(&self, sample: PointerSample) -> bool
Tests the clipped disk for filled circles, or the centered annulus for outline-only circles. Does not inspect alpha, MSAA or painter priority.
Trait Implementations§
Source§impl Clone for ScreenCircleVisual
impl Clone for ScreenCircleVisual
Source§impl Component for ScreenCircleVisual
impl Component for ScreenCircleVisual
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
ComponentRelationshipAccessor required for working with relationships in dynamic contexts. Read moreSource§fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreimpl Copy for ScreenCircleVisual
Source§impl Debug for ScreenCircleVisual
impl Debug for ScreenCircleVisual
Source§impl PartialEq for ScreenCircleVisual
impl PartialEq for ScreenCircleVisual
impl StructuralPartialEq for ScreenCircleVisual
Auto Trait Implementations§
impl Freeze for ScreenCircleVisual
impl RefUnwindSafe for ScreenCircleVisual
impl Send for ScreenCircleVisual
impl Sync for ScreenCircleVisual
impl Unpin for ScreenCircleVisual
impl UnsafeUnpin for ScreenCircleVisual
impl UnwindSafe for ScreenCircleVisual
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<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
Source§fn get_component_ids(
components: &Components,
) -> impl Iterator<Item = Option<ComponentId>>
fn get_component_ids( components: &Components, ) -> impl Iterator<Item = Option<ComponentId>>
Source§impl<C> BundleFromComponents for Cwhere
C: Component,
impl<C> BundleFromComponents for Cwhere
C: Component,
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.