#include <animator.h>
Classes | |
| struct | AnimationState |
| struct | PanelTransition |
| struct | PanelTransitionState |
Public Member Functions | |
| float | Animate (const std::string &panel_id, const std::string &anim_id, float target, float speed=5.0f) |
| ImVec4 | AnimateColor (const std::string &panel_id, const std::string &anim_id, ImVec4 target, float speed=5.0f) |
| void | BeginPanelTransition (const std::string &panel_id, TransitionType type) |
| PanelTransition | UpdatePanelTransition (const std::string &panel_id, float speed=8.0f) |
| bool | IsPanelTransitioning (const std::string &panel_id) const |
| void | ApplyPanelTransitionPre (const std::string &panel_id) |
| void | ApplyPanelTransitionPost (const std::string &panel_id) |
| void | ClearAnimationsForPanel (const std::string &panel_id) |
| void | ClearAllAnimations () |
| bool | IsEnabled () const |
| void | SetMotionPreferences (bool reduced_motion, MotionProfile profile) |
| bool | reduced_motion () const |
| MotionProfile | motion_profile () const |
Static Public Member Functions | |
| static float | Lerp (float a, float b, float t) |
| static float | EaseOutCubic (float t) |
| static float | EaseInOutCubic (float t) |
| static float | EaseOutElastic (float t) |
| static float | EaseOutBack (float t) |
| static ImVec4 | LerpColor (ImVec4 a, ImVec4 b, float t) |
| static MotionProfile | ClampMotionProfile (int raw_profile) |
Private Types | |
| using | AnimationMap = std::unordered_map<std::string, AnimationState> |
Private Member Functions | |
| AnimationState & | GetState (const std::string &panel_id, const std::string &anim_id) |
| float | ComputeStep (float speed) const |
| float | GetProfileSpeedMultiplier () const |
| float | ApplyTransitionEasing (float t) const |
Private Attributes | |
| std::unordered_map< std::string, AnimationMap > | panels_ |
| std::unordered_map< std::string, PanelTransitionState > | panel_transitions_ |
| std::unordered_set< std::string > | pushed_transition_alpha_ |
| bool | reduced_motion_ = false |
| MotionProfile | motion_profile_ = MotionProfile::kStandard |
Definition at line 32 of file animator.h.
|
private |
Definition at line 98 of file animator.h.
|
static |
Definition at line 12 of file animator.cc.
Referenced by Animate(), and LerpColor().
|
static |
Definition at line 16 of file animator.cc.
Referenced by ApplyTransitionEasing(), and yaze::gui::RippleButton().
|
static |
Definition at line 21 of file animator.cc.
Referenced by ApplyTransitionEasing().
|
static |
Definition at line 26 of file animator.cc.
|
static |
Definition at line 33 of file animator.cc.
Referenced by yaze::gui::BouncyButton().
|
static |
Definition at line 40 of file animator.cc.
References Lerp().
Referenced by AnimateColor().

| float yaze::gui::Animator::Animate | ( | const std::string & | panel_id, |
| const std::string & | anim_id, | ||
| float | target, | ||
| float | speed = 5.0f ) |
Definition at line 45 of file animator.cc.
References ComputeStep(), GetState(), IsEnabled(), and Lerp().
Referenced by yaze::gui::BouncyButton(), yaze::gui::DangerButton(), yaze::gui::PaletteColorButton(), yaze::gui::PrimaryButton(), yaze::gui::RippleButton(), yaze::gui::SuccessButton(), yaze::gui::ThemedButton(), yaze::gui::ThemedIconButton(), and yaze::gui::TransparentIconButton().

| ImVec4 yaze::gui::Animator::AnimateColor | ( | const std::string & | panel_id, |
| const std::string & | anim_id, | ||
| ImVec4 | target, | ||
| float | speed = 5.0f ) |
Definition at line 64 of file animator.cc.
References ComputeStep(), GetState(), IsEnabled(), and LerpColor().
Referenced by yaze::editor::DungeonCanvasViewer::DrawRoomPropertyTable(), and yaze::gui::ValueChangeFlash().

| void yaze::gui::Animator::BeginPanelTransition | ( | const std::string & | panel_id, |
| TransitionType | type ) |
Definition at line 111 of file animator.cc.
References IsEnabled(), yaze::gui::kNone, yaze::gui::kSlideDown, yaze::gui::kSlideLeft, yaze::gui::kSlideRight, yaze::gui::kSlideUp, and panel_transitions_.
Referenced by yaze::editor::PanelManager::OnEditorSwitch().

| Animator::PanelTransition yaze::gui::Animator::UpdatePanelTransition | ( | const std::string & | panel_id, |
| float | speed = 8.0f ) |
Definition at line 147 of file animator.cc.
References yaze::gui::Animator::PanelTransition::alpha, ApplyTransitionEasing(), ComputeStep(), yaze::gui::Animator::PanelTransition::is_complete, IsEnabled(), yaze::gui::kExpand, yaze::gui::kFade, yaze::gui::kNone, yaze::gui::kScale, yaze::gui::kSlideDown, yaze::gui::kSlideLeft, yaze::gui::kSlideRight, yaze::gui::kSlideUp, yaze::gui::Animator::PanelTransition::offset_x, yaze::gui::Animator::PanelTransition::offset_y, panel_transitions_, and yaze::gui::Animator::PanelTransition::scale.
Referenced by ApplyPanelTransitionPre().

| bool yaze::gui::Animator::IsPanelTransitioning | ( | const std::string & | panel_id | ) | const |
Definition at line 210 of file animator.cc.
References panel_transitions_.
| void yaze::gui::Animator::ApplyPanelTransitionPre | ( | const std::string & | panel_id | ) |
Definition at line 215 of file animator.cc.
References panel_transitions_, pushed_transition_alpha_, and UpdatePanelTransition().

| void yaze::gui::Animator::ApplyPanelTransitionPost | ( | const std::string & | panel_id | ) |
Definition at line 240 of file animator.cc.
References pushed_transition_alpha_.
| void yaze::gui::Animator::ClearAnimationsForPanel | ( | const std::string & | panel_id | ) |
Definition at line 83 of file animator.cc.
References panel_transitions_, panels_, and pushed_transition_alpha_.
Referenced by yaze::editor::PanelManager::UnregisterEditorPanel().
| void yaze::gui::Animator::ClearAllAnimations | ( | ) |
Definition at line 89 of file animator.cc.
References panel_transitions_, panels_, and pushed_transition_alpha_.
Referenced by yaze::editor::EditorManager::HandleHostVisibilityChanged().
| bool yaze::gui::Animator::IsEnabled | ( | ) | const |
Definition at line 247 of file animator.cc.
References yaze::gui::Theme::enable_animations, yaze::gui::ThemeManager::Get(), yaze::gui::ThemeManager::GetCurrentTheme(), and reduced_motion_.
Referenced by Animate(), AnimateColor(), BeginPanelTransition(), yaze::editor::RightPanelManager::Draw(), and UpdatePanelTransition().

| void yaze::gui::Animator::SetMotionPreferences | ( | bool | reduced_motion, |
| MotionProfile | profile ) |
Definition at line 105 of file animator.cc.
References motion_profile_, reduced_motion(), and reduced_motion_.
Referenced by yaze::editor::SettingsPanel::DrawAppearanceSettings(), and yaze::editor::EditorManager::InitializeServices().

|
inline |
Definition at line 77 of file animator.h.
References reduced_motion_.
Referenced by SetMotionPreferences().
|
inline |
Definition at line 78 of file animator.h.
References motion_profile_.
|
static |
Definition at line 95 of file animator.cc.
References yaze::gui::kRelaxed, yaze::gui::kSnappy, and yaze::gui::kStandard.
Referenced by yaze::editor::SettingsPanel::DrawAppearanceSettings(), and yaze::editor::EditorManager::InitializeServices().
|
private |
Definition at line 258 of file animator.cc.
References panels_.
Referenced by Animate(), and AnimateColor().
|
private |
Definition at line 263 of file animator.cc.
References yaze::gui::Theme::animation_speed, yaze::gui::ThemeManager::Get(), yaze::gui::ThemeManager::GetCurrentTheme(), and GetProfileSpeedMultiplier().
Referenced by Animate(), AnimateColor(), and UpdatePanelTransition().

|
private |
Definition at line 276 of file animator.cc.
References yaze::gui::kRelaxed, yaze::gui::kSnappy, yaze::gui::kStandard, and motion_profile_.
Referenced by ComputeStep().
|
private |
Definition at line 288 of file animator.cc.
References EaseInOutCubic(), EaseOutCubic(), yaze::gui::kRelaxed, yaze::gui::kSnappy, yaze::gui::kStandard, and motion_profile_.
Referenced by UpdatePanelTransition().

|
private |
Definition at line 106 of file animator.h.
Referenced by ClearAllAnimations(), ClearAnimationsForPanel(), and GetState().
|
private |
Definition at line 107 of file animator.h.
Referenced by ApplyPanelTransitionPre(), BeginPanelTransition(), ClearAllAnimations(), ClearAnimationsForPanel(), IsPanelTransitioning(), and UpdatePanelTransition().
|
private |
Definition at line 108 of file animator.h.
Referenced by ApplyPanelTransitionPost(), ApplyPanelTransitionPre(), ClearAllAnimations(), and ClearAnimationsForPanel().
|
private |
Definition at line 110 of file animator.h.
Referenced by IsEnabled(), reduced_motion(), and SetMotionPreferences().
|
private |
Definition at line 111 of file animator.h.
Referenced by ApplyTransitionEasing(), GetProfileSpeedMultiplier(), motion_profile(), and SetMotionPreferences().