Jump to content

Transitions UDF


JRowe
 Share

Recommended Posts

These are a set of functions that calculate an interval, a point between the designated start and end, according to certain equations. These are based off of Robert Penner's easing equations. These functions can be used for GUI animation, Text display, 3D animation, and other effects.

The demo displays the effects of each transition function by moving a label across the GUI.

This site, http://www.gizma.com/easing/, shows off what can happen when you combine the effects, using different ones on x and y motion.

Have fun!

Here's the demo:

Here's the UDF:

_transitions.au3

Here's the Demo Source:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <_Transitions.au3>

$Form2 = GUICreate("Transitions", 672, 587, 225, 108)
GUISetBkColor(0x000000)
$_LinearTween = GUICtrlCreateLabel("", 114, 2, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x80FF80)
$_QuadEaseIn = GUICtrlCreateLabel("", 114, 28, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x80FFFF)
$_QuadEaseOut = GUICtrlCreateLabel("", 114, 53, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0080FF)
$_QuadEaseInOut = GUICtrlCreateLabel("", 114, 79, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF0000)
$_QuarticEaseIn = GUICtrlCreateLabel("", 114, 181, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x800040)
$_CubicEaseInOut = GUICtrlCreateLabel("", 114, 155, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF8000)
$_CubicEaseOut = GUICtrlCreateLabel("", 114, 130, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x004080)
$_CubicEaseIn = GUICtrlCreateLabel("", 114, 104, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFFFF00)
$_SineEaseInOut = GUICtrlCreateLabel("", 114, 386, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x808080)
$_SineEaseOut = GUICtrlCreateLabel("", 114, 360, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x800080)
$_SineEaseIn = GUICtrlCreateLabel("", 114, 335, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$_QuinticEaseInOut = GUICtrlCreateLabel("", 114, 309, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x808040)
$_QuinticEaseOut = GUICtrlCreateLabel("", 114, 283, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x808080)
$_QuinticEaseIn = GUICtrlCreateLabel("", 114, 258, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x804000)
$_QuarticEaseInOut = GUICtrlCreateLabel("", 114, 232, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF0080)
$_QuarticEaseOut = GUICtrlCreateLabel("", 114, 207, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0080C0)
$_CircEaseIn = GUICtrlCreateLabel("", 114, 488, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x8080FF)
$_ExpoEaseInOut = GUICtrlCreateLabel("", 114, 462, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF8080)
$_ExpoEaseOut = GUICtrlCreateLabel("", 114, 437, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x008080)
$_ExpoEaseIn = GUICtrlCreateLabel("", 114, 411, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF80FF)
$_CircEaseOut = GUICtrlCreateLabel("", 114, 512, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x00FF00)
$Button1 = GUICtrlCreateButton("Go!", 288, 552, 75, 25)
$Label22 = GUICtrlCreateLabel("_LinearTween", 16, 0, 72, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label23 = GUICtrlCreateLabel("_QuadEaseIn", 16, 24, 69, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label24 = GUICtrlCreateLabel("_QuadEaseOut", 16, 53, 77, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label25 = GUICtrlCreateLabel("_QuadEaseInOut", 16, 79, 86, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label26 = GUICtrlCreateLabel("_CubicEaseIn", 16, 104, 70, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label27 = GUICtrlCreateLabel("_CubicEaseOut", 16, 130, 78, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label28 = GUICtrlCreateLabel("_CubicEaseInOut", 16, 155, 87, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label29 = GUICtrlCreateLabel("_QuarticEaseIn", 16, 181, 77, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label30 = GUICtrlCreateLabel("_QuarticEaseOut", 16, 207, 85, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label31 = GUICtrlCreateLabel("_QuarticEaseInOut", 16, 232, 94, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label32 = GUICtrlCreateLabel("_QuinticEaseIn", 16, 258, 76, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label33 = GUICtrlCreateLabel("_QuinticEaseOut", 16, 283, 84, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label34 = GUICtrlCreateLabel("_QuinticEaseInOut", 16, 309, 93, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label35 = GUICtrlCreateLabel("_SineEaseIn", 16, 335, 64, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label36 = GUICtrlCreateLabel("_SineEaseOut", 16, 360, 72, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label37 = GUICtrlCreateLabel("_SineEaseInOut", 16, 386, 81, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label38 = GUICtrlCreateLabel("_ExpoEaseIn", 16, 411, 67, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label39 = GUICtrlCreateLabel("_ExpoEaseOut", 16, 437, 75, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label40 = GUICtrlCreateLabel("_ExpoEaseInOut", 16, 462, 84, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label41 = GUICtrlCreateLabel("_CircEaseIn", 16, 488, 61, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label42 = GUICtrlCreateLabel("_CircEaseIn", 16, 512, 61, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$_CircEaseInOut = GUICtrlCreateLabel("", 114, 536, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF8000)
$Label2 = GUICtrlCreateLabel("_CircEaseInOut", 16, 536, 78, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $Button1
        _Transition()

EndSwitch
WEnd


Func _Transition()

    For $i = 1 to 640 Step 1
        GuiCtrlSetPos($_LinearTween, _LinearTween($i, 114, 526, 640), 2)
        GuiCtrlSetPos($_QuadEaseIn, _QuadEaseIn($i, 114, 526, 640), 28)
        GuiCtrlSetPos($_QuadEaseOut, _QuadEaseOut($i, 114, 526, 640), 53)
        GuiCtrlSetPos($_QuadEaseInOut, _QuadEaseInOut($i, 114, 526, 640), 79)
        GuiCtrlSetPos($_CubicEaseIn, _CubicEaseIn($i, 114, 526, 640), 104)
        GuiCtrlSetPos($_CubicEaseOut, _CubicEaseOut($i, 114, 526, 640), 130)
        GuiCtrlSetPos($_CubicEaseInOut, _CubicEaseInOut($i, 114, 526, 640), 155)
        GuiCtrlSetPos($_QuarticEaseIn, _QuarticEaseIn($i, 114, 526, 640), 181)
        GuiCtrlSetPos($_QuarticEaseOut, _QuarticEaseOut($i, 114, 526, 640), 207)
        GuiCtrlSetPos($_QuarticEaseInOut, _QuarticEaseInOut($i, 114, 526, 640), 232)
        GuiCtrlSetPos($_QuinticEaseIn, _QuinticEaseIn($i, 114, 526, 640), 258)
        GuiCtrlSetPos($_QuinticEaseOut, _QuinticEaseOut($i, 114, 526, 640), 283)
        GuiCtrlSetPos($_QuinticEaseInOut, _QuinticEaseInOut($i, 114, 526, 640), 309)
        GuiCtrlSetPos($_SineEaseIn, _SineEaseIn($i, 114, 526, 640), 335)
        GuiCtrlSetPos($_SineEaseOut, _SineEaseOut($i, 114, 526, 640), 360)
        GuiCtrlSetPos($_SineEaseInOut, _SineEaseInOut($i, 114, 526, 640), 386)
        GuiCtrlSetPos($_ExpoEaseIn, _ExpoEaseIn($i, 114, 526, 640), 411)
        GuiCtrlSetPos($_ExpoEaseOut, _ExpoEaseOut($i, 114, 526, 640), 437)
        GuiCtrlSetPos($_ExpoEaseInOut, _ExpoEaseInOut($i, 114, 526, 640), 462)
        GuiCtrlSetPos($_CircEaseIn, _CircEaseIn($i, 114, 526, 640), 488)
        GuiCtrlSetPos($_CircEaseOut, _CircEaseOut($i, 114, 526, 640), 512)
        GuiCtrlSetPos($_CircEaseInOut, _CircEaseInOut($i, 114, 526, 640), 536)
    ;If Animation is too fast, uncomment the Sleep()
    ;Sleep(1)
    Next
EndFunc

Here's the UDF Source:

Global Const $PI = 3.14159265358979
; #FUNCTION# ;===============================================================================
;
; Name...........: _LinearTween
; Description ...: Returns a linear interval between start and end points, no acceleration or easing
; Syntax.........: _LinearTween($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Basic Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _LinearTween($iFrame, $iStartValue, $iInterval, $iEndValue)
    Return $iInterval * ($iFrame / $iEndValue) + $iStartValue
EndFunc   ;==>_LinearTween

; #FUNCTION# ;===============================================================================
;
; Name...........: _QuadEaseIn
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _QuadEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _QuadEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / $iEndValue
    Return $iInterval * $iFrame * $iFrame + $iStartValue
EndFunc   ;==>_QuadEaseIn

; #FUNCTION# ;===============================================================================
;
; Name...........: _QuadEaseOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _QuadEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _QuadEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / $iEndValue
    Return -$iInterval * $iFrame * ($iFrame - 2) + $iStartValue
EndFunc   ;==>_QuadEaseOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _QuadEaseInOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _QuadEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _QuadEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / ($iEndValue / 2)
    If $iFrame < 1 Then
        Return ($iInterval / 2) * $iFrame * $iFrame + $iStartValue
    EndIf
    $iFrame = $iFrame - 1
    Return -($iInterval / 2) * ($iFrame * ($iFrame - 2) - 1) + $iStartValue
EndFunc   ;==>_QuadEaseInOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _CubicEaseIn
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _CubicEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _CubicEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / $iEndValue;
    Return $iInterval * $iFrame * $iFrame * $iFrame + $iStartValue

EndFunc   ;==>_CubicEaseIn

; #FUNCTION# ;===============================================================================
;
; Name...........: _CubicEaseOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _CubicEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _CubicEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / $iEndValue
    $iFrame = $iFrame - 1
    Return $iInterval * ($iFrame * $iFrame * $iFrame + 1) + $iStartValue;
EndFunc   ;==>_CubicEaseOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _CubicEaseInOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _CubicEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _CubicEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / ($iEndValue / 2)
    If $iFrame < 1 Then
        Return $iInterval / 2 * $iFrame * $iFrame * $iFrame + $iStartValue
    EndIf
    $iFrame = $iFrame - 2
    Return $iInterval / 2 * ($iFrame * $iFrame * $iFrame + 2) + $iStartValue

EndFunc   ;==>_CubicEaseInOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _QuarticEaseIn
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _QuarticEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _QuarticEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / $iEndValue;
    Return $iInterval * $iFrame * $iFrame * $iFrame * $iFrame + $iStartValue
EndFunc   ;==>_QuarticEaseIn

; #FUNCTION# ;===============================================================================
;
; Name...........: _QuarticEaseOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _QuarticEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _QuarticEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / $iEndValue
    $iFrame = $iFrame - 1
    Return -$iInterval * ($iFrame * $iFrame * $iFrame * $iFrame - 1) + $iStartValue
EndFunc   ;==>_QuarticEaseOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _QuarticEaseInOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _QuarticEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _QuarticEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / ($iEndValue / 2)
    If $iFrame < 1 Then
        Return $iInterval / 2 * $iFrame * $iFrame * $iFrame * $iFrame + $iStartValue
    EndIf
    $iFrame = $iFrame - 2
    Return -$iInterval / 2 * ($iFrame * $iFrame * $iFrame * $iFrame - 2) + $iStartValue
EndFunc   ;==>_QuarticEaseInOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _QuinticEaseIn
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _QuinticEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _QuinticEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / $iEndValue
    Return $iInterval * $iFrame * $iFrame * $iFrame * $iFrame * $iFrame + $iStartValue
EndFunc   ;==>_QuinticEaseIn

; #FUNCTION# ;===============================================================================
;
; Name...........: _QuinticEaseOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _QuinticEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _QuinticEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / $iEndValue
    $iFrame = $iFrame - 1
    Return $iInterval * ($iFrame * $iFrame * $iFrame * $iFrame * $iFrame + 1) + $iStartValue
EndFunc   ;==>_QuinticEaseOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _QuinticEaseInOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _QuinticEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _QuinticEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / ($iEndValue / 2)
    If $iFrame < 1 Then
        Return $iInterval / 2 * $iFrame * $iFrame * $iFrame * $iFrame * $iFrame + $iStartValue
    EndIf
    $iFrame = $iFrame - 2
    Return $iInterval / 2 * ($iFrame * $iFrame * $iFrame * $iFrame * $iFrame + 2) + $iStartValue
EndFunc   ;==>_QuinticEaseInOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _SineEaseIn
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _SineEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _SineEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
    Return -$iInterval * Cos($iFrame / $iEndValue * ($PI / 2)) + $iInterval + $iStartValue
EndFunc   ;==>_SineEaseIn

; #FUNCTION# ;===============================================================================
;
; Name...........: _SineEaseOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _SineEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _SineEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    Return $iInterval * Sin($iFrame / $iEndValue * ($PI / 2)) + $iStartValue
EndFunc   ;==>_SineEaseOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _SineEaseInOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _SineEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _SineEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    Return -$iInterval / 2 * (Cos($PI * $iFrame / $iEndValue) - 1) + $iStartValue
EndFunc   ;==>_SineEaseInOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _ExpoEaseIn
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _ExpoEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _ExpoEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
    Return $iInterval * (2 ^ (10 * ($iFrame / $iEndValue - 1))) + $iStartValue
EndFunc   ;==>_ExpoEaseIn

; #FUNCTION# ;===============================================================================
;
; Name...........: _ExpoEaseOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _ExpoEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _ExpoEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    ;return c * ( -Math.pow( 2, -10 * t/d ) + 1 )
    Return $iInterval * (-(2 ^ (-10 * $iFrame / $iEndValue)) + 1) + $iStartValue
EndFunc   ;==>_ExpoEaseOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _ExpoEaseInOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _ExpoEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _ExpoEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / ($iEndValue / 2)
    If $iFrame < 1 Then
        Return $iInterval / 2 * (2 ^ (10 * ($iFrame - 1))) + $iStartValue
    EndIf

    $iFrame = $iFrame - 1
    Return $iInterval / 2 * (-(2 ^ (-10 * $iFrame)) + 2) + $iStartValue
EndFunc   ;==>_ExpoEaseInOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _CircEaseIn
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _CircEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _CircEaseIn($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / $iEndValue
    Return -$iInterval * (Sqrt(1 - ($iFrame * $iFrame)) - 1) + $iStartValue
EndFunc   ;==>_CircEaseIn

; #FUNCTION# ;===============================================================================
;
; Name...........: _CircEaseOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _CircEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _CircEaseOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / $iEndValue
    $iFrame = $iFrame - 1
    Return $iInterval * Sqrt(1 - $iFrame * $iFrame) + $iStartValue
EndFunc   ;==>_CircEaseOut

; #FUNCTION# ;===============================================================================
;
; Name...........: _CircEaseInOut
; Description ...: Returns a linear interval between start and end points, acclerating from 0 velocity
; Syntax.........: _CircEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
; Parameters ....: $iFrame - Current frame, or point.
;                   $iStartValue - Beginning point
;                   $iInterval - Change in value
;                   $iEndValue - Number of frames
; Return values .: Success - Returns the point of an interval between $iStartValue and $iEndValue.
;                  Failure - Returns 0
; Author ........: Josh Rowe
; Modified.......:
; Remarks .......: Transitions UDF: Advanced Transition
; Related .......: _QuadEaseIn, _QuadEaseOut, _QuadEaseInOut
; Related .......: _CubicEaseIn, _CubicEaseOut, _CubicEaseInOut
; Related .......: _QuarticEaseIn, _QuarticEaseOut, _QuarticEaseInOut
; Related .......: _QuinticEaseIn, _QuinticEaseOut, _QuinticEaseInOut
; Related .......: _SineEaseIn, _SineEaseOut, _SineEaseInOut
; Related .......: _ExpoEaseIn, _ExpoEaseOut, _ExpoEaseInOut
; Related .......: _CircEaseIn, _CircEaseOut, _CircEaseInOut
; Link ..........;
; Example .......; Yes
;
; ;==========================================================================================
Func _CircEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue)
    $iFrame = $iFrame / ($iEndValue / 2)
    If $iFrame < 1 Then
        Return -$iInterval / 2 * (Sqrt(1 - $iFrame * $iFrame) - 1) + $iStartValue
    EndIf
    $iFrame = $iFrame - 2
    Return $iInterval / 2 * (Sqrt(1 - $iFrame * $iFrame) + 1) + $iStartValue
EndFunc   ;==>_CircEaseInOut
Link to comment
Share on other sites

Link to comment
Share on other sites

Seriously, there's no excuse for that type of post when you're 1200 some posts in. Are you telling me you've never encountered THIS thread before?

EaseDemo.exe is a default compilation of the demo source using the latest version of AutoIt, and nothing more than that.

I even went ahead and tested it on Kaspersky's online file scanner, and it shows up perfectly clean.

I guess I should be glad you're being vigilant. Anyway, thanks for checking it out.

Edited by JRowe
Link to comment
Share on other sites

@JRowe

Awesome UDF !! :D

Edit : maybe a little example :D

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <_Transitions.au3>
$Form2 = GUICreate("Transitions", 672, 587, 225, 108)
GUISetBkColor(0x000000)
$_LinearTween = GUICtrlCreateLabel("A", 114, 2, 12, 12)
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0x80FF80)
$_QuadEaseIn = GUICtrlCreateLabel("W", 114, 28, 12, 12)
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0x80FFFF)
$_QuadEaseOut = GUICtrlCreateLabel("E", 114, 53, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0080FF)
$_QuadEaseInOut = GUICtrlCreateLabel("S", 114, 79, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF0000)
$_CubicEaseIn = GUICtrlCreateLabel("O", 114, 104, 12, 12)
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFFFF00)
$_CubicEaseOut = GUICtrlCreateLabel("M", 114, 130, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x004080)
$_CubicEaseInOut = GUICtrlCreateLabel("E", 114, 155, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF8000)
$_QuarticEaseIn = GUICtrlCreateLabel("", 114, 181, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x800040)
$_QuarticEaseOut = GUICtrlCreateLabel("U", 114, 207, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0080C0)
$_QuarticEaseInOut = GUICtrlCreateLabel("D", 114, 232, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF0080)
$_QuinticEaseIn = GUICtrlCreateLabel("F", 114, 258, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x804000)
$_QuinticEaseOut = GUICtrlCreateLabel(" !", 114, 283, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x808080)
$_QuinticEaseInOut = GUICtrlCreateLabel("", 114, 309, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x808040)
$_SineEaseIn = GUICtrlCreateLabel("N", 114, 335, 12, 12)
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$_SineEaseOut = GUICtrlCreateLabel(" I", 114, 360, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x800080)
$_SineEaseInOut = GUICtrlCreateLabel("C", 114, 386, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x808080)
$_ExpoEaseIn = GUICtrlCreateLabel("E", 114, 411, 12, 12)
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFF80FF)
$_ExpoEaseOut = GUICtrlCreateLabel("", 114, 437, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x008080)
$_ExpoEaseInOut = GUICtrlCreateLabel("J", 114, 462, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF8080)
$_CircEaseIn = GUICtrlCreateLabel("O", 114, 488, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x8080FF)
$_CircEaseOut = GUICtrlCreateLabel("B", 114, 512, 12, 12)
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0x00FF00)
$_CircEaseInOut = GUICtrlCreateLabel(" ", 114, 536, 12, 12)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF8000)
$Button1 = GUICtrlCreateButton("Go!", 288, 552, 75, 25)
$Label22 = GUICtrlCreateLabel("_LinearTween", 16, 0, 72, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label23 = GUICtrlCreateLabel("_QuadEaseIn", 16, 24, 69, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label24 = GUICtrlCreateLabel("_QuadEaseOut", 16, 53, 77, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label25 = GUICtrlCreateLabel("_QuadEaseInOut", 16, 79, 86, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label26 = GUICtrlCreateLabel("_CubicEaseIn", 16, 104, 70, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label27 = GUICtrlCreateLabel("_CubicEaseOut", 16, 130, 78, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label28 = GUICtrlCreateLabel("_CubicEaseInOut", 16, 155, 87, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label29 = GUICtrlCreateLabel("_QuarticEaseIn", 16, 181, 77, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label30 = GUICtrlCreateLabel("_QuarticEaseOut", 16, 207, 85, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label31 = GUICtrlCreateLabel("_QuarticEaseInOut", 16, 232, 94, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label32 = GUICtrlCreateLabel("_QuinticEaseIn", 16, 258, 76, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label33 = GUICtrlCreateLabel("_QuinticEaseOut", 16, 283, 84, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label34 = GUICtrlCreateLabel("_QuinticEaseInOut", 16, 309, 93, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label35 = GUICtrlCreateLabel("_SineEaseIn", 16, 335, 64, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label36 = GUICtrlCreateLabel("_SineEaseOut", 16, 360, 72, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label37 = GUICtrlCreateLabel("_SineEaseInOut", 16, 386, 81, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label38 = GUICtrlCreateLabel("_ExpoEaseIn", 16, 411, 67, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label39 = GUICtrlCreateLabel("_ExpoEaseOut", 16, 437, 75, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label40 = GUICtrlCreateLabel("_ExpoEaseInOut", 16, 462, 84, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label41 = GUICtrlCreateLabel("_CircEaseIn", 16, 488, 61, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label42 = GUICtrlCreateLabel("_CircEaseIn", 16, 512, 61, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Label2 = GUICtrlCreateLabel("_CircEaseInOut", 16, 536, 78, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $Button1
        _Transition()
EndSwitch
WEnd
Func _Transition()
    For $i = 1 to 640 Step 1
        GuiCtrlSetPos($_LinearTween, _LinearTween($i, 114, 526, 640), 2)
        GuiCtrlSetPos($_QuadEaseIn, _QuadEaseIn($i, 114, 526, 640), 28)
        GuiCtrlSetPos($_QuadEaseOut, _QuadEaseOut($i, 114, 526, 640), 53)
        GuiCtrlSetPos($_QuadEaseInOut, _QuadEaseInOut($i, 114, 526, 640), 79)
        GuiCtrlSetPos($_CubicEaseIn, _CubicEaseIn($i, 114, 526, 640), 104)
        GuiCtrlSetPos($_CubicEaseOut, _CubicEaseOut($i, 114, 526, 640), 130)
        GuiCtrlSetPos($_CubicEaseInOut, _CubicEaseInOut($i, 114, 526, 640), 155)
        GuiCtrlSetPos($_QuarticEaseIn, _QuarticEaseIn($i, 114, 526, 640), 181)
        GuiCtrlSetPos($_QuarticEaseOut, _QuarticEaseOut($i, 114, 526, 640), 207)
        GuiCtrlSetPos($_QuarticEaseInOut, _QuarticEaseInOut($i, 114, 526, 640), 232)
        GuiCtrlSetPos($_QuinticEaseIn, _QuinticEaseIn($i, 114, 526, 640), 258)
        GuiCtrlSetPos($_QuinticEaseOut, _QuinticEaseOut($i, 114, 526, 640), 283)
        GuiCtrlSetPos($_QuinticEaseInOut, _QuinticEaseInOut($i, 114, 526, 640), 309)
        GuiCtrlSetPos($_SineEaseIn, _SineEaseIn($i, 114, 526, 640), 335)
        GuiCtrlSetPos($_SineEaseOut, _SineEaseOut($i, 114, 526, 640), 360)
        GuiCtrlSetPos($_SineEaseInOut, _SineEaseInOut($i, 114, 526, 640), 386)
        GuiCtrlSetPos($_ExpoEaseIn, _ExpoEaseIn($i, 114, 526, 640), 411)
        GuiCtrlSetPos($_ExpoEaseOut, _ExpoEaseOut($i, 114, 526, 640), 437)
        GuiCtrlSetPos($_ExpoEaseInOut, _ExpoEaseInOut($i, 114, 526, 640), 462)
        GuiCtrlSetPos($_CircEaseIn, _CircEaseIn($i, 114, 526, 640), 488)
        GuiCtrlSetPos($_CircEaseOut, _CircEaseOut($i, 114, 526, 640), 512)
        GuiCtrlSetPos($_CircEaseInOut, _CircEaseInOut($i, 114, 526, 640), 536)
    ;If Animation is too fast, uncomment the Sleep()
    ;Sleep(1)
    Next
EndFunc

Cheers, FireFox.

Edited by FireFox
Link to comment
Share on other sites

  • 1 year later...

very nice udf...exactly what i wanted..your example explains motion in 1d only..can you please give me an example of 2d....like an window moving from one..corner to another...i.e from (0,0) to (1024,768)..:x will be very grateful to u..!!!

[font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font]

Link to comment
Share on other sites

can you please give me an example of 2d....like an window moving from one..corner to another...

Why not? This is my 2DTransition.au3 script

#include <WinAPI.au3>
#include <GDIPlus.au3>
#include <_Transitions.au3>

Global Const $GUI_EVENT_CLOSE = -3
Global $hWndGui, $hWnd
Global $hDC, $hGraphics, $hBrush

;Spot
Global $nSpotColor = 0xbb80FF80 ;colour
Global $iR = 10     ;radius
Global $nFrames = 45 ;count

Global $TransLine = "_LinearTween,_QuadEaseIn,_QuadEaseOut,_QuadEaseInOut,_CubicEaseIn,_CubicEaseOut,_CubicEaseInOut,_QuarticEaseIn,_QuarticEaseOut,_QuarticEaseInOut,_QuinticEaseIn,_QuinticEaseOut,_QuinticEaseInOut,_SineEaseIn,_SineEaseOut,_SineEaseInOut,_ExpoEaseIn,_ExpoEaseOut,_ExpoEaseInOut,_CircEaseIn,_CircEaseIn,_CircEaseInOut"
Global $Transitions = StringSplit($TransLine,",")
Global $TransChoiceX, $TransChoiceY

$hWndGui = GUICreate("Circle", 400, 440)
_GDIPlus_Startup()

$Pic = GUICtrlCreatePic("", 0, 0, 400, 400)
$hWnd = GUICtrlGetHandle ($Pic)

$hDC = _WinAPI_GetDC($hWnd)
$hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC)
$hBrush = _GDIPlus_BrushCreateSolid($nSpotColor)
_GDIPlus_GraphicsSetSmoothingMode($hGraphics, 4)

GUIRegisterMsg(0x000F, "_OnPaint")
$TransChoiceX = GUICtrlCreateCombo ("", 50, 410, 100, 20)
GUICtrlSetData ($TransChoiceX, StringReplace($TransLine,",","|"), "_LinearTween")
$TransChoiceY = GUICtrlCreateCombo ("", 250, 410, 100, 20)
GUICtrlSetData ($TransChoiceY, StringReplace($TransLine,",","|"), "_LinearTween")

GUISetState()
_OnPaint($hWnd, 0, 0, 0)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $TransChoiceX
        _OnPaint($hWnd, 0, 0, 0)
    Case $TransChoiceY
        _OnPaint($hWnd, 0, 0, 0)
EndSwitch
WEnd

_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDispose($hGraphics)
_WinAPI_ReleaseDC($hWnd, $hDC)
_GDIPlus_Shutdown()

Func _OnPaint($hW, $nMsg, $wParam, $lParam)
local $Line, $x, $y
 If $hW = $hWnd Then

  _GDIPlus_GraphicsClear($hGraphics, 0xff000000)
  for $i = 1 to $nFrames
   $x = Execute(GuiCtrlRead($TransChoiceX) & "($i, 10, 370, $nFrames)")
   $y = Execute(GuiCtrlRead($TransChoiceY) & "($i, 10, 370, $nFrames)")
   _GDIPlus_GraphicsFillEllipse($hGraphics, $x, $y, $iR, $iR, $hBrush)
   sleep(10)
  next
 EndIf
EndFunc

Enjoy!

:x

The point of world view

Link to comment
Share on other sites

Why not? This is my 2DTransition.au3 script

#include <WinAPI.au3>
#include <GDIPlus.au3>
#include <_Transitions.au3>

Global Const $GUI_EVENT_CLOSE = -3
Global $hWndGui, $hWnd
Global $hDC, $hGraphics, $hBrush

;Spot
Global $nSpotColor = 0xbb80FF80 ;colour
Global $iR = 10     ;radius
Global $nFrames = 45 ;count

Global $TransLine = "_LinearTween,_QuadEaseIn,_QuadEaseOut,_QuadEaseInOut,_CubicEaseIn,_CubicEaseOut,_CubicEaseInOut,_QuarticEaseIn,_QuarticEaseOut,_QuarticEaseInOut,_QuinticEaseIn,_QuinticEaseOut,_QuinticEaseInOut,_SineEaseIn,_SineEaseOut,_SineEaseInOut,_ExpoEaseIn,_ExpoEaseOut,_ExpoEaseInOut,_CircEaseIn,_CircEaseIn,_CircEaseInOut"
Global $Transitions = StringSplit($TransLine,",")
Global $TransChoiceX, $TransChoiceY

$hWndGui = GUICreate("Circle", 400, 440)
_GDIPlus_Startup()

$Pic = GUICtrlCreatePic("", 0, 0, 400, 400)
$hWnd = GUICtrlGetHandle ($Pic)

$hDC = _WinAPI_GetDC($hWnd)
$hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC)
$hBrush = _GDIPlus_BrushCreateSolid($nSpotColor)
_GDIPlus_GraphicsSetSmoothingMode($hGraphics, 4)

GUIRegisterMsg(0x000F, "_OnPaint")
$TransChoiceX = GUICtrlCreateCombo ("", 50, 410, 100, 20)
GUICtrlSetData ($TransChoiceX, StringReplace($TransLine,",","|"), "_LinearTween")
$TransChoiceY = GUICtrlCreateCombo ("", 250, 410, 100, 20)
GUICtrlSetData ($TransChoiceY, StringReplace($TransLine,",","|"), "_LinearTween")

GUISetState()
_OnPaint($hWnd, 0, 0, 0)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $TransChoiceX
        _OnPaint($hWnd, 0, 0, 0)
    Case $TransChoiceY
        _OnPaint($hWnd, 0, 0, 0)
EndSwitch
WEnd

_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDispose($hGraphics)
_WinAPI_ReleaseDC($hWnd, $hDC)
_GDIPlus_Shutdown()

Func _OnPaint($hW, $nMsg, $wParam, $lParam)
local $Line, $x, $y
 If $hW = $hWnd Then

  _GDIPlus_GraphicsClear($hGraphics, 0xff000000)
  for $i = 1 to $nFrames
   $x = Execute(GuiCtrlRead($TransChoiceX) & "($i, 10, 370, $nFrames)")
   $y = Execute(GuiCtrlRead($TransChoiceY) & "($i, 10, 370, $nFrames)")
   _GDIPlus_GraphicsFillEllipse($hGraphics, $x, $y, $iR, $iR, $hBrush)
   sleep(10)
  next
 EndIf
EndFunc

Enjoy!

:x

thx 4 the example...actually...i misinterpreted the $endvalue parameter of the functions...so was not able to use the udf properly..again thx 4 the example...

[font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font]

Link to comment
Share on other sites

JRowe, thanks for the awesome UDF, think it could be very useful for certain things (fading in and out, changing colors fluidly, moving controls, animations and stuff like that).

I expanded on it a bit to add some functionality that I thought could be very useful, and tried to make it a bit more user friendly.

Added ability for transitions to be timed. (ex. move from 1-100 in 3 seconds)

Added ability for transitions to be non-blocking. (ex. doesn't run in a loop and therefore allows your main loop to run as transition is occurring, button clicks and stuff like that can happen while transition is going)

Function List:

_Transition_Create() - Creates a transition that can be run at any point in your program.

_Transition_Start() - Starts the created transition.

_Transition_Array_Start() - Starts an array of transitions. (Basically you put the transitions in an array and it starts them all. This improves performance for running many transitions at the same time because it can use the same 'tick' event for all the transitions in the array instead of having one for each transition).

_Transition_Stop() - Stops a transition.

_Transition_Array_Stop() - Stops an array of transitions.

_Transition_Stop_All() - Stops any and all transitions that are running.

Note: Constants for the different types of transitions JRowe created can be found in the UDF.

Examples:

Most basic usage.

#include <_Transitions.au3>

$id = _Transition_Create(1, 1000, 4, "_TransitionOne", $LINEAR_TWEEN); count 1-1000 in 4 seconds, runs "_TransitionOne" every-time the value is updated, and updates it using a linear tween
_Transition_Start($id)

While 1
    sleep(100)
WEnd

Func _TransitionOne($n)
    ConsoleWrite(Round($n) & @CRLF)
EndFunc

Transitions Example.au3

Transitions Example Array.au3

Transition Example.au3

The UDF:

_transitions.au3

I think everything should be fairly straight forward, but you can always look in the UDF and examples if something isn't making sense. If anybody has questions let me know. The only problem I have really run into with the UDF as I made it is performance, so if anybody with more knowledge then me can come up with a better way, or tips on how to make it run better, I would be very interested.

Once again, thank you JRowe for an excellent UDF to build off of.

Peace,

Disabled Monkey

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...