共用方式為


CAnimationVariableIntegerChangeHandler 類別

實作回呼,當動畫變數的值變更時由動畫 API 呼叫。

語法

class CAnimationVariableIntegerChangeHandler : public CUIAnimationVariableIntegerChangeHandlerBase<CAnimationVariableIntegerChangeHandler>;

成員

公用建構函式

名稱 描述
CAnimationVariableIntegerChangeHandler::CAnimationVariableIntegerChangeHandler 建構 CAnimationVariableIntegerChangeHandler 物件。

公用方法

名稱 描述
CAnimationVariableIntegerChangeHandler::CreateInstance 建立回呼的 CAnimationVariableIntegerChangeHandler 實例。
CAnimationVariableIntegerChangeHandler::OnIntegerValueChanged 當動畫變數的值已變更時呼叫。 (覆寫 CUIAnimationVariableIntegerChangeHandlerBase::OnIntegerValueChanged。)
CAnimationVariableIntegerChangeHandler::SetAnimationController 儲存動畫控制器的指標以路由事件。

備註

當您呼叫 CAnimationVariable::EnableIntegerValueChangedEvent 或 CAnimationBaseObject::EnableIntegerValueChangedEvent 時,這個事件處理常式會建立並傳遞至 IUIAnimationVariable::SetVariableIntegerValueChangedEvent(這會針對封裝在動畫物件中的所有動畫變數啟用此事件)。

繼承階層架構

MFC 類別

CUIAnimationCallbackBase

CUIAnimationVariableIntegerChangeHandlerBase

CAnimationVariableIntegerChangeHandler

需求

標頭: afxanimationcontroller.h

CAnimationVariableIntegerChangeHandler::CAnimationVariableIntegerChangeHandler

建構 CAnimationVariableIntegerChangeHandler 物件。

CAnimationVariableIntegerChangeHandler ();

CAnimationVariableIntegerChangeHandler::CreateInstance

建立 CAnimationVariableIntegerChangeHandler 回呼的實例。

static COM_DECLSPEC_NOTHROW HRESULT CreateInstance(
    CAnimationController* pAnimationController,
    IUIAnimationVariableIntegerChangeHandler** ppHandler);

參數

pAnimationController
動畫控制器的指標,將會接收事件。

ppHandler

傳回值

如果方法成功,則會傳回S_OK。 否則,它會傳回 HRESULT 錯誤碼。

CAnimationVariableIntegerChangeHandler::OnIntegerValueChanged

當動畫變數的值已變更時呼叫。

IFACEMETHOD(OnIntegerValueChanged) (
    __in IUIAnimationStoryboard* storyboard,
    __in IUIAnimationVariable* variable,
    __in INT32 newValue,
    __in INT32 previousValue);

參數

腳本
動畫變數的分鏡腳本。

variable
已更新的動畫變數。

newValue
新的四捨五入值。

previousValue
前一個四捨五入的值。

傳回值

如果方法成功,S_OK;否則為 E_FAIL。

CAnimationVariableIntegerChangeHandler::SetAnimationController

儲存動畫控制器的指標以路由事件。

void SetAnimationController(CAnimationController* pAnimationController);

參數

pAnimationController
動畫控制器的指標,將會接收事件。

另請參閱

類別