当前位置: 首页>>代码示例>>C++>>正文


C++ CCLuaStack::pushFloat方法代码示例

本文整理汇总了C++中CCLuaStack::pushFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLuaStack::pushFloat方法的具体用法?C++ CCLuaStack::pushFloat怎么用?C++ CCLuaStack::pushFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCLuaStack的用法示例。


在下文中一共展示了CCLuaStack::pushFloat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addArmatureFileInfoAsyncCallback

void LuaArmatureWrapper::addArmatureFileInfoAsyncCallback(float percent)
{
    if (0 != m_lHandler)
    {
        CCLuaEngine* pEngine = CCLuaEngine::defaultEngine();
        CCLuaStack* pStack = pEngine->getLuaStack();
        
        pStack->pushFloat(percent);
        pStack->executeFunctionByHandler(m_lHandler, 1);
        pStack->clean();
    }
}
开发者ID:237676098,项目名称:quick-cocos2d-x,代码行数:12,代码来源:lua_cocos2dx_cocostudio_manual.cpp

示例2: 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
}
开发者ID:54993306,项目名称:Classes,代码行数:21,代码来源:WidgetLayout.cpp

示例3: 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;
}
开发者ID:cl0uddajka,项目名称:cocoswidget,代码行数:39,代码来源:Widget.cpp


注:本文中的CCLuaStack::pushFloat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。