Qyoto
4.0.5
Qyoto is a C# language binding for Qt
|
The QEasingCurve class provides easing curves for controlling animation. More...
Public Types | |
enum | Type { CosineCurve = 44, Custom = 45, InBack = 33, InBounce = 37, InCirc = 25, InCubic = 5, InCurve = 41, InElastic = 29, InExpo = 21, InOutBack = 35, InOutBounce = 39, InOutCirc = 27, InOutCubic = 7, InOutElastic = 31, InOutExpo = 23, InOutQuad = 3, InOutQuart = 11, InOutQuint = 15, InOutSine = 19, InQuad = 1, InQuart = 9, InQuint = 13, InSine = 17, Linear = 0, NCurveTypes = 46, OutBack = 34, OutBounce = 38, OutCirc = 26, OutCubic = 6, OutCurve = 42, OutElastic = 30, OutExpo = 22, OutInBack = 36, OutInBounce = 40, OutInCirc = 28, OutInCubic = 8, OutInElastic = 32, OutInExpo = 24, OutInQuad = 4, OutInQuart = 12, OutInQuint = 16, OutInSine = 20, OutQuad = 2, OutQuart = 10, OutQuint = 14, OutSine = 18, SineCurve = 43 } |
More... | |
Public Member Functions | |
override bool | Equals (object o) |
override int | GetHashCode () |
QEasingCurve (QEasingCurve other) | |
| |
QEasingCurve (QEasingCurve.Type type=QEasingCurve.Type.Linear) | |
| |
virtual void | CreateProxy () |
new double | ValueForProgress (double progress) |
| |
new void | Dispose () |
Static Public Member Functions | |
static bool | operator!= (QEasingCurve arg1, QEasingCurve arg2) |
| |
static bool | operator== (QEasingCurve arg1, QEasingCurve arg2) |
| |
Protected Member Functions | |
QEasingCurve (System.Type dummy) | |
Protected Attributes | |
SmokeInvocation | interceptor |
Properties | |
new double | Amplitude [get, set] |
| |
new double | CustomType [get, set] |
| |
new double | Overshoot [get, set] |
| |
new double | Period [get, set] |
| |
new QEasingCurve.Type | type [get, set] |
| |
virtual System.IntPtr | SmokeObject [get, set] |
static new QMetaObject | StaticMetaObject [get] |
The QEasingCurve class provides easing curves for controlling animation.
Easing curves describe a function that controls how the speed of the interpolation between 0 and 1 should be. Easing curves allow transitions from one value to another to appear more natural than a simple constant speed would allow. The QEasingCurve class is usually used in conjunction with the QVariantAnimation and QPropertyAnimation classes but can be used on its own. It is usually used to accelerate the interpolation from zero velocity (ease in) or decelerate to zero velocity (ease out). Ease in and ease out can also be combined in the same easing curve.
To calculate the speed of the interpolation, the easing curve provides the function valueForProgress(), where the progress argument specifies the progress of the interpolation: 0 is the start value of the interpolation, 1 is the end value of the interpolation. The returned value is the effective progress of the interpolation. If the returned value is the same as the input value for all input values the easing curve is a linear curve. This is the default behaviour.
For example,
QEasingCurve easing(QEasingCurve::InOutQuad);
for(qreal t = 0.0; t < 1.0; t+=0.1)
qWarning() << "Effective progress" << t << " is
<< easing.valueForProgress(t);
will print the effective progress of the interpolation between 0 and 1.
When using a QPropertyAnimation, the associated easing curve will be used to control the progress of the interpolation between startValue and endValue:
QPropertyAnimation animation;
animation.setStartValue(0);
animation.setEndValue(1000);
animation.setDuration(1000);
animation.setEasingCurve(QEasingCurve::InOutQuad);
The ability to set an amplitude, overshoot, or period depends on the QEasingCurve type. Amplitude access is available to curves that behave as springs such as elastic and bounce curves. Changing the amplitude changes the height of the curve. Period access is only available to elastic curves and setting a higher period slows the rate of bounce. Only curves that have "boomerang" behaviors such as the InBack, OutBack, InOutBack, and OutInBack have overshoot settings. These curves will interpolate beyond the end points and return to the end point, acting similar to a boomerang.
The Easing Curves Example contains samples of QEasingCurve types and lets you change the curve settings.
The type of easing curve.
CosineCurve | |
Custom |
This is returned if the user specified a custom curve type with setCustomType(). Note that you cannot call setType() with this value, but type() can return it. |
InBack |
Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing in: accelerating from zero velocity. |
InBounce |
Easing curve for a bounce (exponentially decaying parabolic bounce) function: accelerating from zero velocity. |
InCirc |
Easing curve for a circular (sqrt(1-t^2)) function: accelerating from zero velocity. |
InCubic |
Easing curve for a cubic (t^3) function: accelerating from zero velocity. |
InCurve | |
InElastic |
Easing curve for an elastic (exponentially decaying sine wave) function: accelerating from zero velocity. The peak amplitude can be set with the amplitude parameter, and the period of decay by the period parameter. |
InExpo |
Easing curve for an exponential (2^t) function: accelerating from zero velocity. |
InOutBack |
Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing in/out: acceleration until halfway, then deceleration. |
InOutBounce |
Easing curve for a bounce (exponentially decaying parabolic bounce) function easing in/out: acceleration until halfway, then deceleration. |
InOutCirc |
Easing curve for a circular (sqrt(1-t^2)) function: acceleration until halfway, then deceleration. |
InOutCubic |
Easing curve for a cubic (t^3) function: acceleration until halfway, then deceleration. |
InOutElastic |
Easing curve for an elastic (exponentially decaying sine wave) function: acceleration until halfway, then deceleration. |
InOutExpo |
Easing curve for an exponential (2^t) function: acceleration until halfway, then deceleration. |
InOutQuad |
Easing curve for a quadratic (t^2) function: acceleration until halfway, then deceleration. |
InOutQuart |
Easing curve for a quartic (t^4) function: acceleration until halfway, then deceleration. |
InOutQuint |
Easing curve for a quintic (t^5) function: acceleration until halfway, then deceleration. |
InOutSine |
Easing curve for a sinusoidal (sin(t)) function: acceleration until halfway, then deceleration. |
InQuad |
Easing curve for a quadratic (t^2) function: accelerating from zero velocity. |
InQuart |
Easing curve for a quartic (t^4) function: accelerating from zero velocity. |
InQuint |
Easing curve for a quintic (t^5) easing in: accelerating from zero velocity. |
InSine |
Easing curve for a sinusoidal (sin(t)) function: accelerating from zero velocity. |
Linear |
Easing curve for a linear (t) function: velocity is constant. |
NCurveTypes | |
OutBack |
Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing out: decelerating to zero velocity. |
OutBounce |
Easing curve for a bounce (exponentially decaying parabolic bounce) function: decelerating from zero velocity. |
OutCirc |
Easing curve for a circular (sqrt(1-t^2)) function: decelerating from zero velocity. |
OutCubic |
Easing curve for a cubic (t^3) function: decelerating to zero velocity. |
OutCurve | |
OutElastic |
Easing curve for an elastic (exponentially decaying sine wave) function: decelerating from zero velocity. The peak amplitude can be set with the amplitude parameter, and the period of decay by the period parameter. |
OutExpo |
Easing curve for an exponential (2^t) function: decelerating from zero velocity. |
OutInBack |
Easing curve for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out/in: deceleration until halfway, then acceleration. |
OutInBounce |
Easing curve for a bounce (exponentially decaying parabolic bounce) function easing out/in: deceleration until halfway, then acceleration. |
OutInCirc |
Easing curve for a circular (sqrt(1-t^2)) function: deceleration until halfway, then acceleration. |
OutInCubic |
Easing curve for a cubic (t^3) function: deceleration until halfway, then acceleration. |
OutInElastic |
Easing curve for an elastic (exponentially decaying sine wave) function: deceleration until halfway, then acceleration. |
OutInExpo |
Easing curve for an exponential (2^t) function: deceleration until halfway, then acceleration. |
OutInQuad |
Easing curve for a quadratic (t^2) function: deceleration until halfway, then acceleration. |
OutInQuart |
Easing curve for a quartic (t^4) function: deceleration until halfway, then acceleration. |
OutInQuint |
Easing curve for a quintic (t^5) function: deceleration until halfway, then acceleration. |
OutInSine |
Easing curve for a sinusoidal (sin(t)) function: deceleration until halfway, then acceleration. |
OutQuad |
Easing curve for a quadratic (t^2) function: decelerating to zero velocity. |
OutQuart |
Easing curve for a quartic (t^4) function: decelerating to zero velocity. |
OutQuint |
Easing curve for a quintic (t^5) function: decelerating to zero velocity. |
OutSine |
Easing curve for a sinusoidal (sin(t)) function: decelerating from zero velocity. |
SineCurve |
|
protected |
QtCore.QEasingCurve.QEasingCurve | ( | QEasingCurve | other | ) |
Construct a copy of other.
QtCore.QEasingCurve.QEasingCurve | ( | QEasingCurve.Type | type = QEasingCurve.Type.Linear | ) |
Constructs an easing curve of the given type.
|
virtual |
new void QtCore.QEasingCurve.Dispose | ( | ) |
override bool QtCore.QEasingCurve.Equals | ( | object | o | ) |
override int QtCore.QEasingCurve.GetHashCode | ( | ) |
|
static |
Compare this easing curve with other and returns true if they are not equal. It will also compare the properties of a curve.
See also operator==().
|
static |
Compare this easing curve with other and returns true if they are equal. It will also compare the properties of a curve.
new double QtCore.QEasingCurve.ValueForProgress | ( | double | progress | ) |
Return the effective progress for the easing curve at progress. While progress must be between 0 and 1, the returned effective progress can be outside those bounds. For instance, QEasingCurve::InBack will return negative values in the beginning of the function.
|
protected |
|
getset |
Returns the amplitude. This is not applicable for all curve types. It is only applicable for bounce and elastic curves (curves of type() QEasingCurve::InBounce, QEasingCurve::OutBounce, QEasingCurve::InOutBounce, QEasingCurve::OutInBounce, QEasingCurve::InElastic, QEasingCurve::OutElastic, QEasingCurve::InOutElastic or QEasingCurve::OutInElastic).
Sets the amplitude to amplitude.
This will set the amplitude of the bounce or the amplitude of the elastic "spring" effect. The higher the number, the higher the amplitude.
|
getset |
Returns the function pointer to the custom easing curve. If type() does not return QEasingCurve::Custom, this function will return 0.
Sets a custom easing curve that is defined by the user in the function func. The signature of the function is qreal myEasingFunction(qreal progress), where progress and the return value is considered to be normalized between 0 and 1. (In some cases the return value can be outside that range) After calling this function type() will return QEasingCurve::Custom. func cannot be zero.
|
getset |
Returns the overshoot. This is not applicable for all curve types. It is only applicable if type() is QEasingCurve::InBack, QEasingCurve::OutBack, QEasingCurve::InOutBack or QEasingCurve::OutInBack.
Sets the overshoot to overshoot.
0 produces no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent.
|
getset |
Returns the period. This is not applicable for all curve types. It is only applicable if type() is QEasingCurve::InElastic, QEasingCurve::OutElastic, QEasingCurve::InOutElastic or QEasingCurve::OutInElastic.
Sets the period to period. Setting a small period value will give a high frequency of the curve. A large period will give it a small frequency.
|
getset |
|
staticget |
|
getset |
Returns the type of the easing curve.
Sets the type of the easing curve to type.