This wiki has been moved to https://github.com/SuperTux/wiki into the mediawiki branch.

Difference between revisions of "ScriptingDisplayEffect"

From SuperTux
Jump to: navigation, search
(Moved this to it's own page like most other things.)
 
(More instance info)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
  
= Summary =
+
== Summary ==
  
<tt>DisplayEffect</tt> is an interface for toying with the display. It has to be instantiated; for your convenience, SuperTux creates an instance named <tt>Effect</tt> when starting the scripting engine. Its usage is preferred.
+
<tt>DisplayEffect</tt> is an interface for toying with the display.
  
= Methods =
+
== Instances ==
 +
SuperTux creates an instance named <tt>Effect</tt> when starting the scripting engine. Its usage is preferred – creating another instance might have unexpected side effects and is strongly discouraged. (Use <tt>sector.Effect</tt> in the console.)
 +
 
 +
== Methods ==
 
{| class="objectlist"
 
{| class="objectlist"
 
! class="method"| fade_out(float fadetime)
 
! class="method"| fade_out(float fadetime)
Line 26: Line 29:
 
|}
 
|}
  
= Constants =
+
== Constants ==
  
 
None
 
None
  
 
[[Category:Scripting Reference]]
 
[[Category:Scripting Reference]]

Revision as of 05:40, 25 June 2007


Summary

DisplayEffect is an interface for toying with the display.

Instances

SuperTux creates an instance named Effect when starting the scripting engine. Its usage is preferred – creating another instance might have unexpected side effects and is strongly discouraged. (Use sector.Effect in the console.)

Methods

fade_out(float fadetime) Gradually fades out the screen to black for the next fadetime seconds.
fade_in(float fadetime) Gradually fades in the screen from black for the next fadetime seconds.
set_black(bool black) Blackens or un-blackens the screen (depending on the value of black).
is_black() Returns: bool; has the screen been blackened by set_black?
Note: Calling fade_in or fade_out resets the return value to false.
sixteen_to_nine(float fadetime) Sets the display ratio to 16:9, effectively adding black bars at the top and bottom of the screen. Should be used before cutscenes. Gradually fades to this state for the next fadetime seconds.
four_to_three(float fadetime) Sets the display ratio to 4:3, removing the black bars added by sixteen_to_nine(). Should be used after cutscenes. Gradually fades to this state for the next fadetime seconds.

Constants

None