| 414 | } |
| 415 | |
| 416 | void ControlSwitch::onTouchEnded(Touch* pTouch, Event* /*pEvent*/) |
| 417 | { |
| 418 | Vec2 location = this->locationFromTouch(pTouch); |
| 419 | |
| 420 | _switchSprite->getThumbSprite()->setColor(Color3B::WHITE); |
| 421 | |
| 422 | if (hasMoved()) |
| 423 | { |
| 424 | setOn(!(location.x < _switchSprite->getContentSize().width / 2), true); |
| 425 | } |
| 426 | else |
| 427 | { |
| 428 | setOn(!_on, true); |
| 429 | } |
| 430 | } |
| 431 | |
| 432 | void ControlSwitch::onTouchCancelled(Touch* pTouch, Event* /*pEvent*/) |
| 433 | { |
nothing calls this directly
no test coverage detected