mirror of
https://github.com/godotengine/godot.git
synced 2024-12-03 09:52:18 +08:00
Fix AnimatedTexture inconsistency when setting frame
This commit is contained in:
parent
15a97a2e84
commit
1ba05b4b3a
@ -46,7 +46,7 @@
|
||||
</methods>
|
||||
<members>
|
||||
<member name="current_frame" type="int" setter="set_current_frame" getter="get_current_frame">
|
||||
Sets the currently visible frame of the texture.
|
||||
Sets the currently visible frame of the texture. Setting this frame while playing resets the current frame time, so the newly selected frame plays for its whole configured frame duration.
|
||||
</member>
|
||||
<member name="frames" type="int" setter="set_frames" getter="get_frames" default="1">
|
||||
Number of frames to use in the animation. While you can create the frames independently with [method set_frame_texture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [constant MAX_FRAMES].
|
||||
|
@ -2704,6 +2704,7 @@ void AnimatedTexture::set_current_frame(int p_frame) {
|
||||
RWLockWrite r(rw_lock);
|
||||
|
||||
current_frame = p_frame;
|
||||
time = 0;
|
||||
}
|
||||
|
||||
int AnimatedTexture::get_current_frame() const {
|
||||
|
Loading…
Reference in New Issue
Block a user