本文整理汇总了C++中ControlButton::convertToWorldSpace方法的典型用法代码示例。如果您正苦于以下问题:C++ ControlButton::convertToWorldSpace方法的具体用法?C++ ControlButton::convertToWorldSpace怎么用?C++ ControlButton::convertToWorldSpace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ControlButton
的用法示例。
在下文中一共展示了ControlButton::convertToWorldSpace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onTouchMoved
void PropColumnMenu::onTouchMoved(Touch *pTouch, Event *pEvent)
{
Point point = pTouch->getLocation();
m_editProp->setPosition(point);
do
{
ControlButton* btn = GAME_UILAYER->getOperationMenu()->getDrugsBtn();
Rect rect;
rect.origin = btn->convertToWorldSpace(Point::ZERO);
rect.size = btn->getContentSize();
if (rect.containsPoint(point))
{
CC_BREAK_IF(m_editProp->getOpacity() == 255);
m_editProp->setOpacity(255);
btn->stopAllActions();
ScaleTo* scaleTo = ScaleTo::create(0.1f, 1.1f);
btn->runAction(scaleTo);
}
else
{
CC_BREAK_IF(m_editProp->getOpacity() == 127);
m_editProp->setOpacity(127);
btn->stopAllActions();
ScaleTo* scaleTo = ScaleTo::create(0.1f, 1.0f);
btn->runAction(scaleTo);
}
}
while (0);
}
示例2: onTouchMoved
void SkillTableView::onTouchMoved(Touch *pTouch, Event *pEvent)
{
Point point = pTouch->getLocation();
if (m_pEditingSkill == NULL)
return;
m_pEditingSkill->setPosition(point);
if (m_pEditingBtn)
{
Rect rect;
rect.origin = m_pEditingBtn->convertToWorldSpace(Point::ZERO);
rect.size = m_pEditingBtn->getContentSize();
if (!rect.containsPoint(point))
{
m_pEditingSkill->setOpacity(127);
m_pEditingBtn->stopAllActions();
ScaleTo* scaleTo = ScaleTo::create(0.1f, 1.0f);
m_pEditingBtn->runAction(scaleTo);
m_pEditingBtn = NULL;
}
}
if (m_pEditingBtn == NULL)
{
for (unsigned int i=0; i<3; i++)
{
ControlButton* btn = GAME_UILAYER->getOperationMenu()->getSkillAttackBtn(i);
Rect rect;
rect.origin = btn->convertToWorldSpace(Point::ZERO);
rect.size = btn->getContentSize();
if (rect.containsPoint(point))
{
m_pEditingSkill->setOpacity(255);
m_pEditingBtn = btn;
m_pEditingBtn->stopAllActions();
ScaleTo* scaleTo = ScaleTo::create(0.1f, 1.1f);
m_pEditingBtn->runAction(scaleTo);
break;
}
}
}
}