本文整理汇总了C++中Touch::GetTouchInfoListN方法的典型用法代码示例。如果您正苦于以下问题:C++ Touch::GetTouchInfoListN方法的具体用法?C++ Touch::GetTouchInfoListN怎么用?C++ Touch::GetTouchInfoListN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Touch
的用法示例。
在下文中一共展示了Touch::GetTouchInfoListN方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onTouchEvent
void CCEGLView::onTouchEvent(const Control& source, TouchStatus status)
{
IList *pList = null;
do
{
CC_BREAK_IF(!m_pDelegate);
int i = 0;
Touch touch;
pList = touch.GetTouchInfoListN(source);
CC_BREAK_IF(pList == NULL);
int pointerNumber = pList->GetCount();
CC_BREAK_IF(pointerNumber <= 0);
int id[30] = {0};
float x[30] = {0};
float y[30] = {0};
for (i = 0; i < pointerNumber; i++) {
TouchInfo *pTouchInfo = static_cast<TouchInfo *>(pList->GetAt(i));
id[i] = (int)pTouchInfo->id;
float tmpX = (float)pTouchInfo->position.x;
float tmpY = (float)pTouchInfo->position.y;
if (!m_bNotHVGA)
{
x[i] = tmpX * 2 / 3;
y[i] = tmpY * 2 / 3;
}
else
{
x[i] = tmpX;
y[i] = tmpY;
}
}
if (TOUCH_PRESSED == status)
{
onTouchesBegin(id, x, y, pointerNumber);
}
else if (TOUCH_MOVED == status)
{
onTouchesMove(id, x, y, pointerNumber);
}
else if (TOUCH_RELEASED == status)
{
onTouchesEnd(id, x, y, pointerNumber);
}
} while (0);
if (pList != null)
{
pList->RemoveAll(true);
delete pList;
}
}
示例2: AppLog
void
TouchEventForm::DisplayMultipointTouchInfo(const Control &source)
{
Touch touch;
IList *pList = null;
pList = touch.GetTouchInfoListN(source);
if (pList)
{
for(int i=0; i<pList->GetCount(); i++ )
{
TouchInfo *pTouchInfo = static_cast<TouchInfo *>(pList->GetAt(i));
AppLog("OnTouchMoved : [%d]%d,%d - %d", pTouchInfo->id, pTouchInfo->position.x ,pTouchInfo->position.y,pTouchInfo->status);
}
pList->RemoveAll(true);
delete pList;
}
}