class EE::UI::CSS::StyleSheetPropertyAnimation¶
Overview¶
#include <stylesheetpropertyanimation.hpp> class StyleSheetPropertyAnimation: public EE::Scene::Action { public: // fields static constexpr String::HashType ID = String::hash("StyleSheetPropertyAnimation"); // methods static void tweenProperty( UIWidget* widget, const Float& normalizedProgress, const PropertyDefinition* property, const std::string& startValue, const std::string& endValue, const Ease::Interpolation& timingFunction, const std::vector<double> timingFunctionParameters, const Uint32& propertyIndex, const bool& isDone ); static StyleSheetPropertyAnimation* fromAnimationKeyframes(const AnimationDefinition& animation, const KeyframesDefinition& keyframes, const PropertyDefinition* propertyDef, UIWidget* widget, const Uint32& propertyIndex, const AnimationOrigin& animationOrigin = AnimationOrigin::Animation); static bool animationSupported(const PropertyType& type); static StyleSheetPropertyAnimation* New(const AnimationDefinition& animation, const PropertyDefinition* propertyDef, std::vector<std::string> states, std::vector<Float> animationStepsTime, const Uint32& propertyIndex, const AnimationOrigin& animationOrigin); static StyleSheetPropertyAnimation* New( const PropertyDefinition* property, const std::string& startValue, const std::string& endValue, const Uint32& propertyIndex, const Time& duration, const Time& delay, const Ease::Interpolation& timingFunction, const std::vector<double>& timingFunctionParameters, const AnimationOrigin& animationOrigin ); virtual void start(); virtual void stop(); virtual void update(const Time& time); virtual bool isDone(); virtual Float getCurrentProgress(); virtual Time getTotalTime(); virtual Action* clone() const; virtual Action* reverse() const; const Uint32& getPropertyIndex() const; const std::string& getStartValue() const; const std::string& getEndValue() const; const Time& getElapsed() const; void setElapsed(const Time& elapsed); const AnimationOrigin& getAnimationOrigin() const; void setRunning(const bool& running); void setPaused(const bool& paused); void notifyClose(); const AnimationDefinition& getAnimation() const; };
Inherited Members¶
public: // typedefs typedef std::function<void(Action*, const ActionType&)> ActionCallback; typedef Uint64 UniqueID; // enums enum ActionType; // methods virtual void start() = 0; virtual void stop() = 0; virtual void update(const Time& time) = 0; virtual bool isDone() = 0; virtual Float getCurrentProgress() = 0; virtual Time getTotalTime() = 0; virtual Action* clone() const; virtual Action* reverse() const; Uint32 getFlags() const; void setFlags(const Uint32& flags); UniqueID getTag() const; void setTag(const UniqueID& tag); Node* getTarget() const; Uint32 addEventListener(const ActionType& actionType, const ActionCallback& callback); Action* on(const ActionType& actionType, const ActionCallback& callback); void removeEventListener(const Uint32& callbackId); void sendEvent(const ActionType& actionType); void setTarget(Node* target); void setId(const Action::UniqueID& id); const Action::UniqueID& getId();
Detailed Documentation¶
Methods¶
virtual void start()
Starts the action.
virtual void stop()
Stops the actions (pause it, it will not reset the animation state).
virtual void update(const Time& time)
Update the action state (shouldn’t be called manually unless you actually now what you are doing)
virtual bool isDone()
Returns:
If the action is completed.
virtual Float getCurrentProgress()
Returns:
The current progress percentage. Normalized between 0 and 1.
virtual Time getTotalTime()
The total action time.
virtual Action* clone() const
Clones the action.
virtual Action* reverse() const
Clones and reverse the action sequence. Note: not all actions can be reversed.