https://wiki.bennugd.org/index.php?title=Fli_start&feed=atom&action=historyFli start - Revision history2024-03-28T11:36:21ZRevision history for this page on the wikiMediaWiki 1.36.2https://wiki.bennugd.org/index.php?title=Fli_start&diff=10822&oldid=prevKloppix at 16:24, 28 July 20122012-07-28T16:24:33Z<p></p>
<p><b>New page</b></p><div>[[Category:functions]]<br />
[[Category:fli]]<br />
[[Category:mod_flic]]<br />
<br />
==Definition==<br />
'''INT''' fli_start ( <'''STRING''' filename> , <'''INT''' x> , <'''INT''' y> , [ <'''INT''' z> , <'''INT''' angle> , <'''INT''' size> , <'''INT''' flags > ] )<br />
<br />
Loads and plays an [http://en.wikipedia.org/wiki/FLIC_%28file_format%29 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.<br />
<br />
Besides setting the x and y coordinates it's parameters also support the [[z]], [[angle]], [[size]] and [[flags]].<br />
<br />
There is also a simpler version of this function, called [[Start_fli]]().<br />
<br />
== Parameters ==<br />
{|<br />
| '''STRING''' filename || - The name of the fli/flc file to load and play.<br />
|-<br />
| '''INT''' x || - The horizontal position.<br />
|-<br />
| '''INT''' y || - The vertical position.<br />
|-<br />
| '''INT''' z || - The depth plane.<br />
|-<br />
| '''INT''' angle || - The rotation.<br />
|-<br />
| '''INT''' size || - The size.<br />
|-<br />
| '''INT''' flags || - The mirroring.<br />
|}<br />
<br />
== Returns ==<br />
'''INT''' : Fli_ID<br />
{|<br />
| 0 || - Loading the fli/flc file failed, i.e. filename incorrect or corrupt/unsupported file version.<br />
|-<br />
| >0 || - The fli_ID of the newly created animation. <br />
|}<br />
<br />
== Notes ==<br />
<br />
Unliḱe [[Start_fli]](), Fli_start() can be used to create several animations.<br />
<br />
== Example ==<br />
<pre><br />
Import "mod_video";<br />
Import "mod_key";<br />
Import "mod_flic";<br />
<br />
private<br />
int iAnimation1;<br />
int iAnimation2;<br />
end<br />
<br />
begin<br />
set_mode(640,480,32);<br />
<br />
//This simple function creates an animation at the indicated coordinates. <br />
iAnimation1=fli_start("animation.fli",50,80); <br />
<br />
//This creates the same animation at another coordinates. To show the power of the additional arguments<br />
//this animation is twice bigger, inclined 30 degrees and translucent. <br />
iAnimation2=fli_start("animation.fli",350,200,0,30000,200,4);<br />
<br />
while(! key(_esc))<br />
<br />
if(key(_1))<br />
//Do nothing until the key is released<br />
while(key(_1))frame; end <br />
if(iAnimation1!=null) //If the animation wasn't terminated...<br />
fli_end(iAnimation1); //...stop only the simple animation...<br />
iAnimation1=null; //...and free the handle<br />
else<br />
iAnimation1=fli_start("animation.fli",50,80); <br />
end<br />
end<br />
<br />
if(key(_2))<br />
//Do nothing until the key is released<br />
while(key(_2))frame; end <br />
if(iAnimation2!=null) //If the animation wasn't terminated...<br />
fli_end(iAnimation2); //...stop only the advanced animation...<br />
iAnimation2=null; //...and free the handle<br />
else<br />
iAnimation2=fli_start("animation.fli",350,200,0,30000,200,4);<br />
end<br />
end<br />
<br />
//If the simple animation was not terminated AND is over rewind it.<br />
if ( (iAnimation1!=null) and (fli_frame(iAnimation1)==0) ) <br />
fli_reset(iAnimation1); <br />
end<br />
<br />
//If the advanced animation was not terminated AND is over rewind it.<br />
if ( (iAnimation2!=null) and (fli_frame(iAnimation2)==0) ) <br />
fli_reset(iAnimation2); <br />
end; <br />
frame;<br />
end<br />
end<br />
</pre><br />
<br />
Used in example: [[set_mode]](), [[Fli_frame]](), [[Fli_end]](), [[Fli_reset]](), [[key]]()<br />
<br />
== See also ==<br />
<br />
[[Fli_end]](), [[Fli_frame]](), [[fli_reset]]().<br />
<br />
{{Moduledocbox<br />
| module = Mod_flic<br />
}}</div>Kloppix