Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:AnimatedImageStartAnimation

From RoR Wiki
Revision as of 19:40, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · AnimatedImage functions
Version: WAR 1.4.8

Starts playing an AnimatedImage.

AnimatedImageStartAnimation(imageName, startFrame, loop, hideWhenComplete, delay)

Arguments

imageName
string – Name of an AnimatedImage window.
startFrame
number – Frame number. The stock UI always passes 0. Fractions are dropped.
loop
boolean – true to start again from the first frame after the last one, false to play once.
hideWhenComplete
boolean – true to hide the image when a non-looping animation ends.
delay
number – Seconds to wait before the animation starts. 0 starts it at once.

Returns

Nothing.

Details

  • If startFrame is greater than the number of frames in the animation, the call does nothing.
  • The function does not show the window. The stock UI shows it first (see the example).
  • When a non-looping animation reaches its end, it stops; with hideWhenComplete the image is also hidden.
  • The playing speed can be changed with AnimatedImageSetPlaySpeed.
  • loop and hideWhenComplete must be real booleans. Passing nil or a number raises an Invalid Parameters error.
  • Note the wording of the second error message: it has no "Window" before the name.

Errors

  • Error in function call 'AnimatedImageStartAnimation': Window %s does not exist
  • Error in function call 'AnimatedImageStartAnimation': %s is not an AnimatedImage

Example

A looping indicator, from ea_menubarwindow/source/menubarwindow.lua:

if ( SystemData.StreamingData.isStreaming )
then
    WindowSetShowing( "StreamingIndicator", true )
    WindowSetShowing( "StreamingIndicatorAnim", true )
    AnimatedImageStartAnimation( "StreamingIndicatorAnim", 0, true, false, 0 )
else
    AnimatedImageStopAnimation( "StreamingIndicatorAnim" )
    WindowSetShowing( "StreamingIndicatorAnim", false )
    WindowSetShowing( "StreamingIndicator", false )
end

A page flip that plays once after a delay and then hides itself, from ea_loadingscreen/source/standardloadingscreen.lua:

AnimatedImageStartAnimation( windowName.."PageFlipAnim", 0, false, true, animDelay )

See also