This wiki is out of date, use the continuation of this wiki instead

Fading

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 19:25, 27 December 2007 (edit)
Sandman (Talk | contribs)
m (Example)
← Previous diff
Current revision (19:54, 15 July 2008) (edit) (undo)
Sandman (Talk | contribs)
m (Definition)
 
(2 intermediate revisions not shown.)
Line 9: Line 9:
== Definition == == Definition ==
-'''INT''' fading+'''INT''' fading = false
-'''Fading''' is a [[global variable]], holding whether the screen is currently fading. This can be caused by the functions [[fade]](), [[fade_on]]() or [[fade_off]](). Its value will be [[true]] if there is fading going on and [[false]] is not.+'''Fading''' is a [[global variable]], holding whether the screen is currently fading. This can be caused by the functions [[fade]](), [[fade_on]]() or [[fade_off]](). Its value will be [[true]] if there is fading going on and [[false]] if not.
== Example == == Example ==
<pre> <pre>
Program faders; Program faders;
 +Private
 + int text_id;
Begin Begin
- write(0,160,100,4,"Look at this fading text!");+ // Write something
 + text_id = write(0,160,100,4,"Look at this fading text!");
 + // Fade screen on and off
fade_off_and_on(); fade_off_and_on();
 + // Wait for ESC key
Repeat Repeat
frame; frame;
Until(key(_ESC)) Until(key(_ESC))
 + // Kill all other processes and clear up text
let_me_alone(); let_me_alone();
 + delete_text(text_id);
End End
Line 40: Line 47:
End End
</pre> </pre>
-Used in example: [[write]](), [[key]](), [[let_me_alone]](), [[fade]]()+Used in example: [[write]](), [[key]](), [[let_me_alone]](), [[delete_text]](), [[fade]]()
{{Globals}} {{Globals}}

Current revision

Up to Global Variables



[edit] Definition

INT fading = false

Fading is a global variable, holding whether the screen is currently fading. This can be caused by the functions fade(), fade_on() or fade_off(). Its value will be true if there is fading going on and false if not.

[edit] Example

Program faders;
Private
    int text_id;
Begin

    // Write something
    text_id = write(0,160,100,4,"Look at this fading text!");

    // Fade screen on and off
    fade_off_and_on();

    // Wait for ESC key
    Repeat
        frame;
    Until(key(_ESC))

    // Kill all other processes and clear up text
    let_me_alone();
    delete_text(text_id);

End

Process fade_off_and_on()
Begin
    Loop
        fade(0,0,0,4); // Fade to black
        while(fading) frame; end // Wait for the fading to finish
        fade(100,100,100,4); // Fade to normal
        while(fading) frame; end // Wait for the fading to finish
    End
End

Used in example: write(), key(), let_me_alone(), delete_text(), fade()


Global variables
ArgcArgvCdinfoDump_typeFadingFileinfoFpsFrame_timeFull_screenGraph_modeMouseOs_idRestore_typeScale_modeScrollSound_channelsSound_freqSound_modeText_flagsText_zTimer
Personal tools