pub struct ScreenLineVisual { /* private fields */ }Expand description
A round-ended line in top-left/downward logical screen pixels.
FrameUpdate can move it while simulation is paused. No Transform2d or camera is required. Draw order shares layer/depth/source ordering with the screen UI. Values are CPU-only; Engine performs its authoritative portability check at extraction.
Implementations§
Source§impl ScreenLineVisual
impl ScreenLineVisual
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(
start: LogicalScreenPosition,
end: LogicalScreenPosition,
width: f32,
color: Color,
) -> Result<Self, ScreenVisualError>
pub fn new( start: LogicalScreenPosition, end: LogicalScreenPosition, width: f32, color: Color, ) -> Result<Self, ScreenVisualError>
Creates a nondegenerate line with a positive logical width and normalized color.
Sourcepub const fn start(&self) -> LogicalScreenPosition
pub const fn start(&self) -> LogicalScreenPosition
Returns the first endpoint in logical pixels.
Sourcepub const fn end(&self) -> LogicalScreenPosition
pub const fn end(&self) -> LogicalScreenPosition
Returns the second endpoint in logical pixels.
Sourcepub fn set_endpoints(
&mut self,
start: LogicalScreenPosition,
end: LogicalScreenPosition,
) -> Result<(), ScreenVisualError>
pub fn set_endpoints( &mut self, start: LogicalScreenPosition, end: LogicalScreenPosition, ) -> Result<(), ScreenVisualError>
Sets both endpoints atomically; nonfinite or coincident endpoints are rejected.
Sourcepub fn set_stroke(&mut self, stroke: Stroke) -> Result<(), ScreenVisualError>
pub fn set_stroke(&mut self, stroke: Stroke) -> Result<(), ScreenVisualError>
Sets logical width and color atomically.
Sourcepub fn contains_pointer(&self, sample: PointerSample) -> bool
pub fn contains_pointer(&self, sample: PointerSample) -> bool
Tests the clipped round-ended stroke, independently of entity/input routing.
Trait Implementations§
Source§impl Clone for ScreenLineVisual
impl Clone for ScreenLineVisual
Source§impl Component for ScreenLineVisual
impl Component for ScreenLineVisual
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 ScreenLineVisual
Source§impl Debug for ScreenLineVisual
impl Debug for ScreenLineVisual
Source§impl PartialEq for ScreenLineVisual
impl PartialEq for ScreenLineVisual
impl StructuralPartialEq for ScreenLineVisual
Auto Trait Implementations§
impl Freeze for ScreenLineVisual
impl RefUnwindSafe for ScreenLineVisual
impl Send for ScreenLineVisual
impl Sync for ScreenLineVisual
impl Unpin for ScreenLineVisual
impl UnsafeUnpin for ScreenLineVisual
impl UnwindSafe for ScreenLineVisual
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.