yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::gui::Animator Class Reference

#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

AnimationStateGetState (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, AnimationMappanels_
 
std::unordered_map< std::string, PanelTransitionStatepanel_transitions_
 
std::unordered_set< std::string > pushed_transition_alpha_
 
bool reduced_motion_ = false
 
MotionProfile motion_profile_ = MotionProfile::kStandard
 

Detailed Description

Definition at line 32 of file animator.h.

Member Typedef Documentation

◆ AnimationMap

using yaze::gui::Animator::AnimationMap = std::unordered_map<std::string, AnimationState>
private

Definition at line 98 of file animator.h.

Member Function Documentation

◆ Lerp()

float yaze::gui::Animator::Lerp ( float a,
float b,
float t )
static

Definition at line 12 of file animator.cc.

Referenced by Animate(), and LerpColor().

◆ EaseOutCubic()

float yaze::gui::Animator::EaseOutCubic ( float t)
static

Definition at line 16 of file animator.cc.

Referenced by ApplyTransitionEasing(), and yaze::gui::RippleButton().

◆ EaseInOutCubic()

float yaze::gui::Animator::EaseInOutCubic ( float t)
static

Definition at line 21 of file animator.cc.

Referenced by ApplyTransitionEasing().

◆ EaseOutElastic()

float yaze::gui::Animator::EaseOutElastic ( float t)
static

Definition at line 26 of file animator.cc.

◆ EaseOutBack()

float yaze::gui::Animator::EaseOutBack ( float t)
static

Definition at line 33 of file animator.cc.

Referenced by yaze::gui::BouncyButton().

◆ LerpColor()

ImVec4 yaze::gui::Animator::LerpColor ( ImVec4 a,
ImVec4 b,
float t )
static

Definition at line 40 of file animator.cc.

References Lerp().

Referenced by AnimateColor().

Here is the call graph for this function:

◆ Animate()

float yaze::gui::Animator::Animate ( const std::string & panel_id,
const std::string & anim_id,
float target,
float speed = 5.0f )

◆ AnimateColor()

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().

Here is the call graph for this function:

◆ BeginPanelTransition()

void yaze::gui::Animator::BeginPanelTransition ( const std::string & panel_id,
TransitionType type )

◆ UpdatePanelTransition()

◆ IsPanelTransitioning()

bool yaze::gui::Animator::IsPanelTransitioning ( const std::string & panel_id) const

Definition at line 210 of file animator.cc.

References panel_transitions_.

◆ ApplyPanelTransitionPre()

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().

Here is the call graph for this function:

◆ ApplyPanelTransitionPost()

void yaze::gui::Animator::ApplyPanelTransitionPost ( const std::string & panel_id)

Definition at line 240 of file animator.cc.

References pushed_transition_alpha_.

◆ ClearAnimationsForPanel()

void yaze::gui::Animator::ClearAnimationsForPanel ( const std::string & panel_id)

◆ ClearAllAnimations()

void yaze::gui::Animator::ClearAllAnimations ( )

◆ IsEnabled()

bool yaze::gui::Animator::IsEnabled ( ) const

◆ SetMotionPreferences()

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().

Here is the call graph for this function:

◆ reduced_motion()

bool yaze::gui::Animator::reduced_motion ( ) const
inline

Definition at line 77 of file animator.h.

References reduced_motion_.

Referenced by SetMotionPreferences().

◆ motion_profile()

MotionProfile yaze::gui::Animator::motion_profile ( ) const
inline

Definition at line 78 of file animator.h.

References motion_profile_.

◆ ClampMotionProfile()

MotionProfile yaze::gui::Animator::ClampMotionProfile ( int raw_profile)
static

◆ GetState()

Animator::AnimationState & yaze::gui::Animator::GetState ( const std::string & panel_id,
const std::string & anim_id )
private

Definition at line 258 of file animator.cc.

References panels_.

Referenced by Animate(), and AnimateColor().

◆ ComputeStep()

float yaze::gui::Animator::ComputeStep ( float speed) const
private

◆ GetProfileSpeedMultiplier()

float yaze::gui::Animator::GetProfileSpeedMultiplier ( ) const
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().

◆ ApplyTransitionEasing()

float yaze::gui::Animator::ApplyTransitionEasing ( float t) const
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().

Here is the call graph for this function:

Member Data Documentation

◆ panels_

std::unordered_map<std::string, AnimationMap> yaze::gui::Animator::panels_
private

Definition at line 106 of file animator.h.

Referenced by ClearAllAnimations(), ClearAnimationsForPanel(), and GetState().

◆ panel_transitions_

std::unordered_map<std::string, PanelTransitionState> yaze::gui::Animator::panel_transitions_
private

◆ pushed_transition_alpha_

std::unordered_set<std::string> yaze::gui::Animator::pushed_transition_alpha_
private

◆ reduced_motion_

bool yaze::gui::Animator::reduced_motion_ = false
private

Definition at line 110 of file animator.h.

Referenced by IsEnabled(), reduced_motion(), and SetMotionPreferences().

◆ motion_profile_

MotionProfile yaze::gui::Animator::motion_profile_ = MotionProfile::kStandard
private

The documentation for this class was generated from the following files: