Graphical Window Animation

version 3 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next

  • Section: Altering Currently Playing Animations

    Graphical Window Animation provides a number of phrases which alter animations that are currently in progress. Under normal circumstances, these will be useful only for looped animations.

    If we do not want to loop through the entire animation but only the latter portion of it, we can follow the "animate" command with this instruction:

        loop animation from frame (a number)

    For example:

        animate the current reel at 5 fps, looping;
        loop animation from frame 3

    This would play the animation in full once, then loop continuously through the final three frames. (The frame number is simply the position of the desired entry in the reel's list of figure-names, with the first figure enumerated as 1.)

    The phrase

        interrupt animation

    immediately halts an animation already in progress. By default, any animation in progress is stopped when the player looks or moves from room to room. The extension defines two rules which the author can use to control the default behavior, the stop animation when going rule and the stop animation when looking rule, and authors can interfere with these rules as needed to obtain the desired effect.

    If we want to bring a looping animation to a smooth end, we can use the phrase:

        stop looping animation

    This will allow the animation to continue to the final frame (as defined in the "animate" phrase), and will then halt it. For completeness, a "loop animation" phrase is provided. This causes an originally unlooped animation to begin looping once it reaches the final frame; this is unlikely to be useful, however, because under normal circumstances we can't be sure that an unlooped animation will receive the command before it ends; once an animation has ended, it cannot be altered by further commands.

    The author may want to change the speed of a looped animation while it is still playing. This can be done with the phrase:

        change the animation speed to (number) fps

    Any currently running animation will speed up or slow down to the new frame-rate (in frames per second) defined in this phrase.