DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
Motion.h File Reference

Classes

struct  DekiEditor::Motion::RowHover
 List rows that ImGui draws (tree nodes, selectables) with a fading highlight. More...

Namespaces

namespace  DekiEditor
namespace  DekiEditor::Motion

Functions

bool DekiEditor::Motion::ReduceMotion ()
 Reduce motion: every animation lands on its target the frame it is asked for.
void DekiEditor::Motion::SetReduceMotion (bool reduce)
float DekiEditor::Motion::To (ImGuiID id, float target, float seconds)
 Move id's value linearly toward target so a full 0 -> 1 sweep takes seconds, and return it.
float DekiEditor::Motion::ToFrom (ImGuiID id, float from, float target, float seconds)
 Like To, but the first sighting starts at from instead of the target, for things that should animate IN when they first appear (a popup opening, a toast arriving).
float DekiEditor::Motion::Follow (ImGuiID id, float target, float seconds, float epsilon=0.01f)
 Chase an unbounded value (a scroll position, a zoom level): covers most of the remaining distance within seconds, fast at first and settling (exponential ease-out), and snaps when within epsilon.
void DekiEditor::Motion::Set (ImGuiID id, float value)
 Jump id to value now, with no animation (e.g.
bool DekiEditor::Motion::AnyMoving ()
 Whether anything animated this frame is still moving.
float DekiEditor::Motion::EaseOut (float t)
 Curves: map linear progress t in [0, 1] to eased progress.
float DekiEditor::Motion::Smooth (float t)
ImVec4 DekiEditor::Motion::Mix (const ImVec4 &a, const ImVec4 &b, float t)
 Blend two colours by t in [0, 1].
float DekiEditor::Motion::Hover (ImGuiID id, bool hovered)
 Hover highlight in one call: eased 0 -> 1 while hovered, back to 0 after.
float DekiEditor::Motion::Progress (ImGuiID id, float fraction)
 A progress bar's fill: glides toward fraction as work reports it in steps, and drops back at once when it goes down (a new run starting at 0).
ImU32 DekiEditor::Motion::WithAlpha (ImU32 col, float t)
 col with its alpha scaled by t in [0, 1].
float DekiEditor::Motion::ItemHover (bool hovered)
 For a hand-drawn hover background, right after its item (usually an InvisibleButton): the fade for the item just submitted.
float DekiEditor::Motion::ItemPress ()
 Press feedback for the same kind of item, also right after it: eased 0 -> 1 while it is held under the pointer, back to 0 after release.
ImU32 DekiEditor::Motion::PressShade (float t)
float DekiEditor::Motion::RowHighlight (ImGuiID id, bool selected, bool hovered, float selectedAlpha, float hoveredAlpha, float *outSelected=nullptr)
 A row's highlight strength: the stronger of its selection fade (scaled by selectedAlpha) and its hover fade (by hoveredAlpha).

Variables

constexpr float DekiEditor::Motion::kFast = 0.10f
constexpr float DekiEditor::Motion::kNormal = 0.14f
constexpr float DekiEditor::Motion::kSlow = 0.20f