Squash Fade creation
Fade_Squash

Creates a new Squash fade object.

myFade = new Fade_Squash( Type, Blending_Mode, bReverse )
myFade = new Fade_Squash( Type, Blending_Mode )
myFade = new Fade_Squash( Type )
myFade = new Fade_Squash( )

Return value
Newly created fade object.

Parameters
  • Type
    Pointer to a distortion function; This can be one of your own (takes 3 surfaces (target, oldFrame, newFrame) and a value from 0 to 1 and applies the desired effect to the target) or one of the following:
    • Squash_BookLeft
      The effect of a book opening / closing to the left
    • Squash_BookRight
      The effect of a book opening / closing to the right
    • Squash_BookUp
      The effect of a book opening / closing to the top
    • Squash_BookDown
      The effect of a book opening / closing to the bottom
  • Blending_Mode
    Pointer to a blending function; This can be one of your own (takes a value from 0 to 1 and returns a value from 0 to 255) or one of the following:
    • Blending_Off
      No blending used
    • Blending_Linear
      Linear blending used (default)
    • Blending_Square
      Blending amount related to the square of the time
    • Blending_Root
      Blending amount related to the square root of the time
    • Blending_Sine
      Starts and ends solid
    • Blending_Log
      Logarithmic rise in opacity
    • Blending_Inverse
      Not sure what this does
    • Blending_Smooth
      More complex version of linear. Gives a more natural result.
    • Blending_Power
      Interesting blending based on the square of the time
    • Blending_Sine2
      Again, more interesting, based on the sine of the time
    • Blending_Electric
      Slow flashing which gets faster towards the end of the fade
    • Blending_Bounce
      Blending "bounces" through the fade
  • bReverse
    TRUE to play the transition backwards. FALSE (default) to play it normally
Comments

When making your own blending functions, it is recomended to only return integers from 0 to 255 to avoid unexpected behaviour. This can be achieved by adding Max(Min(Round( [result] ),255),0) when the value is returned (replace [result] with your variable) This is not necessary if you know the value will be safe.
It is possible, though fairly pointless, to change the blending mode later on through SetFade.
When you make your own squash functions, you should make all changes to the first surface; not the other 2.



JAM © 2005 no one in particular
Project started by David Evans in 2005