Glimmr Canvas Animation

version 1/111030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Basic animation phrases

    To animate (A - an animation track) at (N - a number):
        now the animation-flag of A is g-active;
        now the timer interval of A is N to the nearest (standard interval divisor);
        now the timer count of A is 0;
        start a Glulx timer of N milliseconds.

    [Nearly the same as the basic animate... phrase, but intended for use only once an animation is already running; as such, it does not reset the timer count to 0. The phrase for starting the Glulx timer will set the timer count appropriately.]
    To time (A - an animation track) at (N - a number):
        now the animation-flag of A is g-active;
        now the timer interval of A is N to the nearest (standard interval divisor);
        start a Glulx timer of N milliseconds.
        
    To activate (A - an animation track):
        now the animation-flag of A is g-active;
        #if utilizing animation debugging;
        say "[>console][CA]Animation track [i][A][/i] activated.[<]";
        #end if.

    To deactivate (A - an animation track):
        now the animation-flag of A is g-inactive;
        #if utilizing animation debugging;
        say "[>console][CA]Animation track [i][A][/i] deactivated.[<]";
        #end if.
        
    To decide which number is (N - a number) frame/frames/-- per/-- second/fps:
        decide on 1000 / N.

    To decide which number is (N - a number) milliseconds/ms per frame:
        decide on N.
        
    To set up (track - an animation track) as (preset - animation preset) with duration (len - a number):
        now the track is preset;
        now cycles completed of the track is 0;
        unless len is 0:
            now the animation-length of the track is len;
        now the current-frame of the track is 1;
        #if utilizing animation debugging;
        describe animation track;
        #end if.
        
    To set up (track - an animation track) as (preset - animation preset):
        now the track is preset;
        now cycles completed of the track is 0;
        now the current-frame of the track is 1;
        #if utilizing animation debugging;
        describe animation track;
        #end if.

    To describe animation (track - an animation track):
        say "[>console][CA]Track [i][track][/i] has been set up as a [animation preset of the track] animation with animation-length of [animation-length of the track] frame(s)[if the track is cycling], cycling[end if].[<]";