Fli reset

From Bennu Wiki
Jump to navigation Jump to search


Definition

INT fli_reset ( < Fli_ID > )

Rewinds the specified fli/flc animation created by start_fli().

Parameters

INT Fli_ID - Identifier of the animation you want to rewind.

Returns

INT : Success

1 - The animation has been reset.

Example

Import "mod_video";
Import "mod_key";
Import "mod_flic";

private
  int iAnimation1;
  int iAnimation2;
end

begin
  set_mode(640,480,32);

  //This simple function creates an animation at the indicated coordinates.   
  iAnimation1=fli_start("animation.fli",50,80); 

  //This creates the same animation at another coordinates. To show the power of the additional arguments
  //this animation is twice bigger, inclined 30 degrees and translucent. 
  iAnimation2=fli_start("animation.fli",350,200,0,30000,200,4);

  while(! key(_esc))

    if(key(_1))
      //Do nothing until the key is released
      while(key(_1))frame; end 
      if(iAnimation1!=null)    //If the animation wasn't terminated...
        fli_end(iAnimation1);  //...stop only the simple animation...
        iAnimation1=null;      //...and free the handle
      else
        iAnimation1=fli_start("animation.fli",50,80); 
      end
    end

    if(key(_2))
      //Do nothing until the key is released
      while(key(_2))frame; end 
      if(iAnimation2!=null)    //If the animation wasn't terminated...
        fli_end(iAnimation2);  //...stop only the advanced animation...
        iAnimation2=null;      //...and free the handle
      else
        iAnimation2=fli_start("animation.fli",350,200,0,30000,200,4);
      end
    end

    //If the simple animation was not terminated AND is over rewind it.
    if ( (iAnimation1!=null) and (fli_frame(iAnimation1)==0) )  
      fli_reset(iAnimation1);     				
    end

    //If the advanced animation was not terminated AND is over rewind it.
    if ( (iAnimation2!=null) and (fli_frame(iAnimation2)==0) ) 
      fli_reset(iAnimation2);  					
    end;							
    frame;
  end
end

Used in example: set_mode(), Fli_start(), Fli_frame(), Fli_end(), key()

Notes

To reset an animation created by Start_fli() use Reset_fli() instead.

See also

Fli_end(), Fli_frame(), Fli_start().


Mod_flic
Functions Endfli()Fliangle()Fliend()Fliflags()Fliframe()Fligetinfo()Flimove()Fliparams()Flireset()Flisize()Flistart()Fliz()Framefli()Resetfli()Startfli()