Masks Fade creation
Fade_Masks

Creates a new Masks fade object.

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

Return value
Newly created fade object.

Parameters
  • Type
    Pointer to a mask function; This can be one of your own (takes a surface and a value from 0 to 1 and draws the desired shapes onto the surface) or one of the following:
    • Masks_Circle
      Simple circle which expands to fill the screen
    • Masks_Triangle
      Triangle pointing left which expands to fill the screen
    • Masks_TriangleB
      Same as Triangle, but faces right
    • Masks_Square
      A square which expands to fill the screen
    • Masks_Rectangle
      A rectangle which expands to fill the screen
    • Masks_Diamond
      A diamond which expands to fill the screen
    • Masks_Star
      A star which rotates and expands to fill the screen
    • Masks_LinesUp
      Diagonal lines (NW/SE) fill the screen
    • Masks_LinesDown
      Diagonal lines (NE/SW) fill the screen
    • Masks_Cross
      A mix of LinesUp and LinesDown
    • Masks_TopBottom
      Diagonal bar (NE/SW) moves in from top+bottom
    • Masks_BottomTop
      Diagonal bar (NW/SE) moves in from top+bottom
    • Masks_BallTopBottom
      Same as TopBottom but with balls instead of bars
    • Masks_BallBottomTop
      Same as BottomTop but with balls instead of bars
    • Masks_BallAll
      4 circles; one in each corner; expand to fill the screen
    • Masks_BallFive
      A mix of BallAll and Circle
    • Masks_CircleCrossOver
      Top-left and bottom-right have balls expanding, while top-right and bottom-left have a mathematical pattern
    • Masks_TopBottomWithLines
      It's just getting silly now
    • Masks_BallTopBottomWithLines
      Try the fades for yourself and see what you think :P
    • Masks_BottomTopWithLines
      Same as TopBottomWithLines but mirrored
    • Masks_BallBottomTopWithLines
      Same as BallTopBottomWithLines but mirrored
    • Masks_OpenH
      Frame splits vertically and opens
    • Masks_OpenV
      Frame splits horizontally and opens
    • Masks_Eye
      An eye-like effect
    • Masks_Magic
      A strange effect. Note that you should not use Blending_Off with this.
  • 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.



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