Pause LuaRenderObject animation

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
jurgy
Inserter
Inserter
Posts: 20
Joined: Wed Feb 27, 2019 5:55 pm
Contact:

Pause LuaRenderObject animation

Post by jurgy »

Hi,

I wish there was an easier way to pause animations of LuaRenderObjects.

Setting the animation_speed field to 0, jumps the animation to the first frame and later if you increase the speed again the animation jumps to the frame as if the animation was never paused.

It is possible to account for this by using the tick the animation was started at, then when pausing calculating the current frame it's at, set that as the animation_offset and then when starting the animation again calculate the number of ticks the animation was paused and adjust the offset again accordingly but this is a fairly elaborate process and it would be really helpful if the API supported this natively.

Thanks!
curiosity
Filter Inserter
Filter Inserter
Posts: 607
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Pause LuaRenderObject animation

Post by curiosity »

Would be great if it recalculated the offset to preserve the current frame instead of a dedicated pause function. Then it will work for any change of speed.
jurgy
Inserter
Inserter
Posts: 20
Joined: Wed Feb 27, 2019 5:55 pm
Contact:

Re: Pause LuaRenderObject animation

Post by jurgy »

curiosity wrote: Sun Mar 09, 2025 12:42 pm Would be great if it recalculated the offset to preserve the current frame instead of a dedicated pause function. Then it will work for any change of speed.
Yeah, that's a better idea, I guess
Post Reply

Return to “Modding interface requests”