本文整理汇总了C++中CCDirector::getScrollWheelDispatcher方法的典型用法代码示例。如果您正苦于以下问题:C++ CCDirector::getScrollWheelDispatcher方法的具体用法?C++ CCDirector::getScrollWheelDispatcher怎么用?C++ CCDirector::getScrollWheelDispatcher使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCDirector
的用法示例。
在下文中一共展示了CCDirector::getScrollWheelDispatcher方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onEnter
/// Callbacks
void CCLayer::onEnter()
{
CCDirector *pDirector = CCDirector::sharedDirector();
// register 'parent' nodes first
// since events are propagated in reverse order
if (m_bIsTouchEnabled)
{
this->registerWithTouchDispatcher();
}
// then iterate over all the children
CCNode::onEnter();
// add this layer to concern the Accelerometer Sensor
if (m_bIsAccelerometerEnabled)
{
pDirector->getAccelerometer()->setDelegate(this);
}
// add this layer to concern the kaypad msg
if (m_bIsKeypadEnabled)
{
pDirector->getKeypadDispatcher()->addDelegate(this);
}
if (m_bIsScrollWheelEnabled)
{
pDirector->getScrollWheelDispatcher()->addDelegate(this);
}
}
示例2: setScrollWheelEnabled
/// isAccelerometerEnabled setter
void CCLayer::setScrollWheelEnabled(bool enabled)
{
if (enabled != m_bIsScrollWheelEnabled)
{
m_bIsScrollWheelEnabled = enabled;
if (m_bIsRunning)
{
CCDirector *pDirector = CCDirector::sharedDirector();
if (enabled)
{
pDirector->getScrollWheelDispatcher()->addDelegate(this);
}
else
{
pDirector->getScrollWheelDispatcher()->removeDelegate(this);
}
}
}
}