Skip to main content

Animation

Struct Animation 

Source
pub struct Animation {}
Expand description

Factory for the built-in node animations.

See the module docs for the difference between the event-driven and persistent families.

Implementations§

Source§

impl Animation

Source

pub fn pulse( painter: &Painter, center: Pos2, zoom: f32, initial_time: Instant, color: Color32, ) -> bool

One frame of an expanding, fading disc centred on center.

Reads as “one thing happened here”. Plays for PULSE_DURATION. Returns true while still playing.

Source

pub fn ripple( painter: &Painter, center: Pos2, zoom: f32, initial_time: Instant, color: Color32, ) -> bool

One frame of three staggered expanding rings.

Where Animation::pulse reads as a single event, the repetition here reads as “activity is ongoing”. Plays for RIPPLE_DURATION. Returns true while still playing.

Source

pub fn countdown_arc( painter: &Painter, center: Pos2, zoom: f32, initial_time: Instant, color: Color32, ) -> bool

One frame of a ring that empties clockwise from 12 o’clock.

The remaining arc is the remaining fraction of COUNTDOWN_DURATION, which makes it a natural fit for “how old is this information”. Returns true while still playing.

Source

pub fn scale_in( painter: &Painter, center: Pos2, zoom: f32, initial_time: Instant, color: Color32, ) -> bool

One frame of a disc that grows past its final size and settles back.

Meant for nodes that just appeared. Plays for SCALE_IN_DURATION. Returns true while still playing.

Source

pub fn crosshair( painter: &Painter, center: Pos2, zoom: f32, initial_time: Instant, color: Color32, ) -> bool

One frame of four ticks converging onto the node.

Reads as “target acquired”; pairs well with selection. Plays for CROSSHAIR_DURATION. Returns true while still playing.

Source

pub fn halo( painter: &Painter, center: Pos2, zoom: f32, time: f32, color: Color32, )

One frame of a ring whose opacity breathes in and out.

For lasting state — “you are here”, “this system is camped”. time is the frame time in seconds (ui.input(|i| i.time)).

The radius has a floor in screen pixels so the halo does not vanish when the map is zoomed far out.

One frame of a thick ring blinking on and off.

This is the effect markers have always used, factored out of the widget so it can be selected and reused like any other. time is the frame time in seconds.

Source

pub fn orbit( painter: &Painter, center: Pos2, zoom: f32, time: f32, color: Color32, )

One frame of a dot orbiting the node, with a faint guide ring.

Reads as “under observation”. time is the frame time in seconds.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more