summaryrefslogtreecommitdiff
path: root/scene/resources/texture.h
diff options
context:
space:
mode:
authorMicky <micheledevita2@gmail.com>2022-09-01 12:09:06 +0200
committerMicky <micheledevita2@gmail.com>2022-09-06 21:40:09 +0200
commit9c9c5f662f0ea231412eda5097b1cc585889fed2 (patch)
tree4d914c5bfc950ec6867355ad0c9b8b5d16a2bc45 /scene/resources/texture.h
parent5628ab9215d61fc2b7223b465626873368aaf66b (diff)
Rework AnimatedTexture's `fps` into `speed_scale`
`fps` has been turned into `speed_scale`. It now affects the scale of the entire animation. If `speed_scale` is a negative value, the animation is played in reverse. `frame_n/delay_sec` has been renamed to `frame_n/duration` _(prefixes exist, making the previous name redundant)_. Setters and getters, documentation updated, too.
Diffstat (limited to 'scene/resources/texture.h')
-rw-r--r--scene/resources/texture.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/scene/resources/texture.h b/scene/resources/texture.h
index 1ce3b27065..da4b8046a5 100644
--- a/scene/resources/texture.h
+++ b/scene/resources/texture.h
@@ -922,7 +922,7 @@ private:
struct Frame {
Ref<Texture2D> texture;
- float delay_sec = 0.0;
+ float duration = 1.0;
};
Frame frames[MAX_FRAMES];
@@ -930,7 +930,7 @@ private:
int current_frame = 0;
bool pause = false;
bool one_shot = false;
- float fps = 4.0;
+ float speed_scale = 1.0;
float time = 0.0;
@@ -958,11 +958,11 @@ public:
void set_frame_texture(int p_frame, const Ref<Texture2D> &p_texture);
Ref<Texture2D> get_frame_texture(int p_frame) const;
- void set_frame_delay(int p_frame, float p_delay_sec);
- float get_frame_delay(int p_frame) const;
+ void set_frame_duration(int p_frame, float p_duration);
+ float get_frame_duration(int p_frame) const;
- void set_fps(float p_fps);
- float get_fps() const;
+ void set_speed_scale(float p_scale);
+ float get_speed_scale() const;
virtual int get_width() const override;
virtual int get_height() const override;