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); }
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; } } } }