Delen via


CCustomTransition Class

Implements a custom transition.

class CCustomTransition : public CBaseTransition;

Members

Public Constructors

Name

Description

CCustomTransition::CCustomTransition

Constructs a custom transition object.

Public Methods

Name

Description

CCustomTransition::Create

Calls the transition library to create encapsulated transition COM object. (Overrides CBaseTransition::Create.)

CCustomTransition::SetInitialValue

Sets an initial value, which will be applied to an animation variable associated with this transition.

CCustomTransition::SetInitialVelocity

Sets an initial velocity, which will be applied to an animation variable associated with this transition.

Protected Data Members

Name

Description

CCustomTransition::m_bInitialValueSpecified

Specifies whether the initial value was specified with SetInitialValue.

CCustomTransition::m_bInitialVelocitySpecified

Specifies whether the initial velocity was specified with SetInitialVelocity.

CCustomTransition::m_initialValue

Stores the initial value.

CCustomTransition::m_initialVelocity

Stores the initial velocity.

CCustomTransition::m_pInterpolator

Stores a pointer to a custom interpolator.

Remarks

The CCustomTransitions class allows developers to implement custom transitions. It's created and used as a standard transition, but its constructor accepts as parameter a pointer to a custom interpolator. Perform the following steps to use custom transitions: 1. Derive a class from CCustomInterpolator and implement at least InterpolateValue method. 2. Ensure that the lifetime of custom interpolator object must be longer than duration of animation where it's used. 3. Instantiate (using operator new) a CCustomTransition object and pass a pointer to custom interpolator in the constructor. 4. Call CCustomTransition::SetInitialValue and CCustomTransition::SetInitialVelocity if these parameters are required for custom interpolation. 5. Pass the pointer to custom transition to AddTransition method of animation object, whose value should be animated with the custom algorithm. 6. When the value of animation object should change Windows Animation API will call InterpolateValue (and other relevant methods) in CCustomInterpolator.

Inheritance Hierarchy

CObject

CBaseTransition

CCustomTransition

Requirements

Header: afxanimationcontroller.h

See Also

Other Resources

MFC Classes