本文整理汇总了C++中CCLuaStack::pushCCObject方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLuaStack::pushCCObject方法的具体用法?C++ CCLuaStack::pushCCObject怎么用?C++ CCLuaStack::pushCCObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCLuaStack
的用法示例。
在下文中一共展示了CCLuaStack::pushCCObject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: executeTouchBeganHandler
CWidgetTouchModel CWidget::executeTouchBeganHandler(CCTouch* pTouch)
{
m_bTouchInterrupt = false;
if( m_pTouchBeganListener && m_pTouchBeganHandler )
{
CWidgetTouchModel eUserTouchModel = (m_pTouchBeganListener->*m_pTouchBeganHandler)(m_pThisObject, pTouch);
if( eUserTouchModel == eWidgetTouchNone )
{
return eWidgetTouchNone;
}
else
{
this->onTouchBegan(pTouch);
return eUserTouchModel;
}
}
#if USING_LUA
else if( m_nTouchBeganScriptHandler != 0 )
{
CCLuaEngine* pEngine = CCLuaEngine::defaultEngine();
CCLuaStack* pStack = pEngine->getLuaStack();
pStack->pushCCObject(m_pThisObject, "CCObject");
pStack->pushCCObject(pTouch, "CCTouch");
CCArray* pRetArray = new CCArray();
pRetArray->initWithCapacity(1);
int nRet = pStack->executeFunctionReturnArray(m_nTouchBeganScriptHandler, 2, 1, pRetArray);
CCAssert(pRetArray->count() > 0, "return count = 0");
CCDouble* pIntModel = (CCDouble*) pRetArray->objectAtIndex(0);
CWidgetTouchModel eUserTouchModel = (CWidgetTouchModel) ( (int)pIntModel->getValue() );
delete pRetArray;
pStack->clean();
if( eUserTouchModel == eWidgetTouchNone )
{
return eWidgetTouchNone;
}
else
{
this->onTouchBegan(pTouch);
return eUserTouchModel;
}
}
#endif
return this->onTouchBegan(pTouch);
}
示例2: eventCallbackFunc
void LuaCocoStudioEventListener::eventCallbackFunc(CCObject* sender,int eventType)
{
if (0 != m_lHandler)
{
CCLuaEngine* pEngine = CCLuaEngine::defaultEngine();
CCLuaStack* pStack = pEngine->getLuaStack();
pStack->pushCCObject(sender, "CCObject");
pStack->pushInt(eventType);
pStack->executeFunctionByHandler(m_lHandler, 2);
pStack->clean();
}
}
示例3: executeTouchCancelledAfterLongClickHandler
void CWidgetLayout::executeTouchCancelledAfterLongClickHandler(CCObject* pSender, CCTouch *pTouch, float fDuration)
{
if( m_pTouchCancelledAfterLongClickListener && m_pTouchCancelledAfterLongClickHandler )
{
(m_pTouchCancelledAfterLongClickListener->*m_pTouchCancelledAfterLongClickHandler)(pSender, pTouch, fDuration);
}
#if USING_LUA
else if( m_pTouchCancelledAfterLongClickScriptHandler != 0 )
{
CCLuaEngine* pEngine = CCLuaEngine::defaultEngine();
CCLuaStack* pStack = pEngine->getLuaStack();
pStack->pushCCObject(pSender, "CCObject");
pStack->pushCCObject(pTouch, "CCTouch");
pStack->pushFloat(fDuration);
int nRet = pStack->executeFunctionByHandler(m_pTouchCancelledAfterLongClickScriptHandler, 3);
pStack->clean();
}
#endif
}
示例4: executeTouchCancelledHandler
void CWidget::executeTouchCancelledHandler(CCTouch* pTouch, float fDuration)
{
if( m_pTouchCancelledListener && m_pTouchCancelledHandler )
{
if( !(m_pTouchCancelledListener->*m_pTouchCancelledHandler)(m_pThisObject, pTouch, fDuration) )
{
return;
}
}
#if USING_LUA
else if( m_nTouchCancelledScriptHandler != 0 )
{
CCLuaEngine* pEngine = CCLuaEngine::defaultEngine();
CCLuaStack* pStack = pEngine->getLuaStack();
pStack->pushCCObject(m_pThisObject, "CCObject");
pStack->pushCCObject(pTouch, "CCTouch");
pStack->pushFloat(fDuration);
CCArray* pRetArray = new CCArray();
pRetArray->initWithCapacity(1);
int nRet = pStack->executeFunctionReturnArray(m_nTouchCancelledScriptHandler, 3, 1, pRetArray);
CCAssert(pRetArray->count() > 0, "return count = 0");
CCBool* pBool = (CCBool*) pRetArray->objectAtIndex(0);
bool bContinue = pBool->getValue();
delete pRetArray;
pStack->clean();
if(!bContinue)
{
return;
}
}
#endif
this->onTouchCancelled(pTouch, fDuration);
return;
}
示例5: movementEventCallback
void LuaArmatureWrapper::movementEventCallback(CCArmature* armature, MovementEventType type,const char* movementID)
{
if (0 != m_lHandler)
{
CCLuaEngine* pEngine = CCLuaEngine::defaultEngine();
CCLuaStack* pStack = pEngine->getLuaStack();
pStack->pushCCObject(armature, "CCArmature");
pStack->pushInt(type);
pStack->pushString(movementID);
pStack->executeFunctionByHandler(m_lHandler, 3);
pStack->clean();
}
}
示例6: frameEventCallback
void LuaArmatureWrapper::frameEventCallback(CCBone* bone, const char* frameEventName, int orginFrameIndex, int currentFrameIndex)
{
if (0 != m_lHandler)
{
CCLuaEngine* pEngine = CCLuaEngine::defaultEngine();
CCLuaStack* pStack = pEngine->getLuaStack();
pStack->pushCCObject(bone, "CCBone");
pStack->pushString(frameEventName);
pStack->pushInt(orginFrameIndex);
pStack->pushInt(currentFrameIndex);
pStack->executeFunctionByHandler(m_lHandler, 4);
pStack->clean();
}
}