Fli start

From Bennu Wiki
Jump to: navigation, search


Definition

INT fli_start ( <STRING filename> , <INT x> , <INT y> , [ <INT z> , <INT angle> , <INT size> , <INT flags > ] )

Loads and plays an autodesk animator flic animation. This is a simple, but antique animation format, that only supports 256 colors. It doesn't support sound. It's a memory efficient format, with some form of compression.

Besides setting the x and y coordinates it's parameters also support the z, angle, size and flags.

There is also a simpler version of this function, called Start_fli().

Parameters

STRING filename - The name of the fli/flc file to load and play.
INT x - The horizontal position.
INT y - The vertical position.
INT z - The depth plane.
INT angle - The rotation.
INT size - The size.
INT flags - The mirroring.

Returns

INT : Fli_ID

0 - Loading the fli/flc file failed, i.e. filename incorrect or corrupt/unsupported file version.
>0 - The fli_ID of the newly created animation.

Notes

Unliḱe Start_fli(), Fli_start() can be used to create several animations.

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_frame(), Fli_end(), Fli_reset(), key()

See also

Fli_end(), Fli_frame(), fli_reset().


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