2
0

UIAnimation.h 590 B

12345678910111213141516171819202122232425
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <Jolt/Core/RTTI.h>
  5. class UIElement;
  6. /// Base class for UI element animations
  7. class UIAnimation
  8. {
  9. public:
  10. JPH_DECLARE_RTTI_VIRTUAL_BASE(UIAnimation)
  11. /// Destructor
  12. virtual ~UIAnimation() = default;
  13. ///@name Interface
  14. virtual void Init(UIElement *inElement) { }
  15. virtual bool Update(UIElement *inElement, float inDeltaTime) { return true; } ///< Returns false when done
  16. virtual void Exit(UIElement *inElement) { }
  17. };
  18. using UIAnimationVector = Array<UIAnimation *>;