21 #ifndef GF_ACTIVITIES_H 22 #define GF_ACTIVITIES_H 33 #ifndef DOXYGEN_SHOULD_SKIP_THIS 62 m_tween.setOrigin(origin);
71 return m_tween.getOrigin();
80 m_tween.setTarget(target);
89 return m_tween.getTarget();
98 m_tween.setDuration(duration);
107 return m_tween.getDuration();
111 virtual void restart()
override;
114 Tween<
float> m_tween;
145 m_tween.setOrigin(origin);
154 return m_tween.getOrigin();
163 m_tween.setTarget(target);
172 return m_tween.getTarget();
181 m_tween.setDuration(duration);
190 return m_tween.getDuration();
194 virtual void restart()
override;
197 Tween<
float> m_tween;
226 m_tween.setOrigin(origin);
235 return m_tween.getOrigin();
244 m_tween.setTarget(target);
253 return m_tween.getTarget();
262 m_tween.setDuration(duration);
271 return m_tween.getDuration();
275 virtual void restart()
override;
278 Tween<Vector2f> m_tween;
307 m_tween.setOrigin(origin);
316 return m_tween.getOrigin();
325 m_tween.setTarget(target);
334 return m_tween.getTarget();
343 m_tween.setDuration(duration);
352 return m_tween.getDuration();
356 virtual void restart()
override;
359 Tween<Color4f> m_tween;
377 virtual void restart()
override;
380 std::function<
void()> m_callback;
399 virtual void restart()
override;
426 virtual void restart()
override;
429 std::size_t m_current;
430 std::vector<Activity*> m_activities;
449 virtual void restart()
override;
486 virtual void restart()
override;
491 std::vector<Activity*> m_activities;
495 #ifndef DOXYGEN_SHOULD_SKIP_THIS Time getDuration() const noexcept
Get the duration of the activity.
Definition: Activities.h:270
Time getDuration() const noexcept
Get the duration of the activity.
Definition: Activities.h:106
void setOrigin(Vector2f origin)
Change the origin of the activity.
Definition: Activities.h:225
virtual void restart() override
Restart the activity.
virtual ActivityStatus run(Time time) override
Run the activity.
void addActivity(Activity &activity)
Add an activity to the sequence.
virtual void restart() override
Restart the activity.
Color4f getTarget() const noexcept
Get the target of the activity.
Definition: Activities.h:333
An activity for a change of position.
Definition: Activities.h:207
void setTarget(float target)
Change the target of the activity.
Definition: Activities.h:79
void setOrigin(float origin)
Change the origin of the activity.
Definition: Activities.h:61
void addActivity(Activity &activity)
Add an activity to the set.
void setDuration(Time duration)
Change the duration of the activity.
Definition: Activities.h:97
DelayActivity(Time duration)
Constructor.
ParallelActivity(Finish finish=Finish::Any)
Constructor.
virtual ActivityStatus run(Time time) override
Run the activity.
ActivityStatus
Status of an activity.
Definition: Activity.h:38
Finish
The type of finish for the activity.
Definition: Activities.h:466
Represents a time value.
Definition: Time.h:73
void setTarget(Color4f target)
Change the target of the activity.
Definition: Activities.h:324
Time getDuration() const noexcept
Get the duration of the activity.
Definition: Activities.h:189
ColorActivity(Color4f origin, Color4f target, Color4f &color, Time duration, Easing easing=Ease::linear)
Constructor.
SequenceActivity()
Constructor.
If all of the activities ends.
Time getDuration() const noexcept
Get the duration of the activity.
Definition: Activities.h:351
RepeatActivity(Activity &activity, unsigned repeat=0)
Constructor.
An activity to run an activity several times.
Definition: Activities.h:438
virtual ActivityStatus run(Time time) override
Run the activity.
void setOrigin(Color4f origin)
Change the origin of the activity.
Definition: Activities.h:306
void setDuration(Time duration)
Change the duration of the activity.
Definition: Activities.h:180
An activity to wait for a predefined duration.
Definition: Activities.h:389
virtual ActivityStatus run(Time time) override
Run the activity.
virtual void restart() override
Restart the activity.
The namespace for gf classes.
Definition: Action.h:34
static float linear(float t)
Linear easing.
virtual ActivityStatus run(Time time) override
Run the activity.
virtual ActivityStatus run(Time time) override
Run the activity.
void setOrigin(float origin)
Change the origin of the activity.
Definition: Activities.h:144
Vector2f getTarget() const noexcept
Get the target of the activity.
Definition: Activities.h:252
An activity for a change of angle.
Definition: Activities.h:126
An activity to run several activities in parallel.
Definition: Activities.h:461
void setTarget(float target)
Change the target of the activity.
Definition: Activities.h:162
Predefined easing functions.
Definition: Easings.h:239
void setDuration(Time duration)
Change the duration of the activity.
Definition: Activities.h:261
virtual ActivityStatus run(Time time) override
Run the activity.
MoveToActivity(Vector2f origin, Vector2f target, Vector2f &position, Time duration, Easing easing=Ease::linear)
Constructor.
virtual void restart() override
Restart the activity.
Vector2f getOrigin() const noexcept
Get the origin of the activity.
Definition: Activities.h:234
void setDuration(Time duration)
Change the duration of the activity.
Definition: Activities.h:342
An activity for a change of color.
Definition: Activities.h:288
An activity to run several activities sequentially.
Definition: Activities.h:411
ValueActivity(float origin, float target, float &value, Time duration, Easing easing=Ease::linear)
Constructor.
virtual void restart() override
Restart the activity.
An activity for a simple float value.
Definition: Activities.h:43
virtual void restart() override
Restart the activity.
virtual ActivityStatus run(Time time) override
Run the activity.
An activity for calling a function once.
Definition: Activities.h:367
An interpolation between two values.
Definition: Tween.h:40
#define GF_API
Definition: Portability.h:35
If any of the activities ends.
CallbackActivity(std::function< void()> callback)
Constructor.
RotateToActivity(float origin, float target, float &angle, Time duration, Easing easing=Ease::linear)
Constructor.
float getTarget() const noexcept
Get the target of the activity.
Definition: Activities.h:88
float getOrigin() const noexcept
Get the origin of the activity.
Definition: Activities.h:70
float getOrigin() const noexcept
Get the origin of the activity.
Definition: Activities.h:153
A game activity.
Definition: Activity.h:62
virtual ActivityStatus run(Time time) override
Run the activity.
virtual void restart() override
Restart the activity.
float getTarget() const noexcept
Get the target of the activity.
Definition: Activities.h:171
virtual void restart() override
Restart the activity.
virtual void restart() override
Restart the activity.
void setTarget(Vector2f target)
Change the target of the activity.
Definition: Activities.h:243
Color4f getOrigin() const noexcept
Get the origin of the activity.
Definition: Activities.h:315