コード例 #1
0
KDvoid TestMultiTouch::ccTouchesMoved ( CCSet* pTouches, CCEvent* pEvent )
{
	for ( CCSetIterator  iter = pTouches->begin ( ); iter != pTouches->end ( ); iter++ )
	{
        CCTouch*     pTouch = (CCTouch*) ( *iter );
        TouchPoint*  pTouchPoint = (TouchPoint*) m_tDictionary.objectForKey ( pTouch->getID ( ) );

        pTouchPoint->setTouchPos ( this->convertTouchToNodeSpace ( pTouch ) );
	}
}
コード例 #2
0
void MutiTouchTestLayer::ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent)
{
    CCSetIterator iter = pTouches->begin();
    for (; iter != pTouches->end(); iter++)
    {
        CCTouch* pTouch = (CCTouch*)(*iter);
        TouchPoint* pTP = (TouchPoint*)s_dic.objectForKey(pTouch->getID());
        CCPoint location = pTouch->getLocation();
        pTP->setTouchPos(location);
    }
}
コード例 #3
0
ファイル: MutiTouchTest.cpp プロジェクト: csdnnet/hiygame
void MutiTouchTestLayer::ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent)
{
    CCSetIterator iter = pTouches->begin();
    for (; iter != pTouches->end(); iter++)
    {
        CCTouch* pTouch = (CCTouch*)(*iter);
        TouchPoint* pTP = (TouchPoint*)s_dic.objectForKey(pTouch->getID());
        CCPoint location = pTouch->locationInView();
        location = CCDirector::sharedDirector()->convertToGL(location);
        pTP->setTouchPos(location);
    }
}
コード例 #4
0
KDvoid TestMultiTouch::ccTouchesBegan ( CCSet* pTouches, CCEvent* pEvent )
{
    for ( CCSetIterator  iter = pTouches->begin ( ); iter != pTouches->end ( ); iter++ )
    {
        CCTouch*	 pTouch = (CCTouch*) ( *iter );
        TouchPoint*  pTouchPoint = TouchPoint::create ( this );

        pTouchPoint->setTouchPos   ( this->convertTouchToNodeSpace ( pTouch ) );
        pTouchPoint->setTouchColor ( l_aTouchColors [ pTouch->getID ( ) ]);

        this->addChild ( pTouchPoint );
        m_tDictionary.setObject ( pTouchPoint, pTouch->getID ( ) );		
    }
}
コード例 #5
0
void MutiTouchTestLayer::ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent)
{
    CCSetIterator iter = pTouches->begin();
    for (; iter != pTouches->end(); iter++)
    {
        CCTouch* pTouch = (CCTouch*)(*iter);
        TouchPoint* pTouchPoint = TouchPoint::touchPointWithParent(this);
        CCPoint location = pTouch->getLocation();

        pTouchPoint->setTouchPos(location);
        pTouchPoint->setTouchColor(s_TouchColors[pTouch->getID()]);

        addChild(pTouchPoint);
        s_dic.setObject(pTouchPoint, pTouch->getID());
    }
    

}