| 385 | } |
| 386 | |
| 387 | bool ControlSwitch::onTouchBegan(Touch* pTouch, Event* /*pEvent*/) |
| 388 | { |
| 389 | if (!isTouchInside(pTouch) || !isEnabled() || !isVisible()) |
| 390 | { |
| 391 | return false; |
| 392 | } |
| 393 | |
| 394 | _moved = false; |
| 395 | |
| 396 | Vec2 location = this->locationFromTouch(pTouch); |
| 397 | |
| 398 | _initialTouchXPosition = location.x - _switchSprite->getSliderXPosition(); |
| 399 | |
| 400 | _switchSprite->getThumbSprite()->setColor(Color3B::GRAY); |
| 401 | _switchSprite->needsLayout(); |
| 402 | |
| 403 | return true; |
| 404 | } |
| 405 | |
| 406 | void ControlSwitch::onTouchMoved(Touch* pTouch, Event* /*pEvent*/) |
| 407 | { |
nothing calls this directly
no test coverage detected