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
impl Animation
Sourcepub fn pulse(
painter: &Painter,
center: Pos2,
zoom: f32,
initial_time: Instant,
color: Color32,
) -> bool
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.
Sourcepub fn ripple(
painter: &Painter,
center: Pos2,
zoom: f32,
initial_time: Instant,
color: Color32,
) -> bool
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.
Sourcepub fn countdown_arc(
painter: &Painter,
center: Pos2,
zoom: f32,
initial_time: Instant,
color: Color32,
) -> bool
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.
Sourcepub fn scale_in(
painter: &Painter,
center: Pos2,
zoom: f32,
initial_time: Instant,
color: Color32,
) -> bool
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.
Sourcepub fn crosshair(
painter: &Painter,
center: Pos2,
zoom: f32,
initial_time: Instant,
color: Color32,
) -> bool
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.
Sourcepub fn halo(
painter: &Painter,
center: Pos2,
zoom: f32,
time: f32,
color: Color32,
)
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.
Auto Trait Implementations§
impl Freeze for Animation
impl RefUnwindSafe for Animation
impl Send for Animation
impl Sync for Animation
impl Unpin for Animation
impl UnsafeUnpin for Animation
impl UnwindSafe for Animation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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