bool XRect::touchBeganInternal( ci::app::TouchEvent::Touch touch ) { bool hit = hitTest( touch.getPos() ); if (hit && mScript) mScript->call("touchBegan", touch.getPos().x, touch.getPos().y); return hit; }
bool ThreeStateButton::touchEnded(ci::app::TouchEvent::Touch touch) { return mRect.contains( globalToLocal( touch.getPos() ) ); }
bool TwoStateButton::touchEnded(ci::app::TouchEvent::Touch touch) { mDownCount--; return mRect.contains( globalToLocal( touch.getPos() ) ); }
bool TwoStateButton::touchBegan(ci::app::TouchEvent::Touch touch) { bool inside = mRect.contains( globalToLocal( touch.getPos() ) ); if (inside) mDownCount++; return inside; }
bool ToggleButton::touchBegan(ci::app::TouchEvent::Touch touch) { return mRect.contains( globalToLocal( touch.getPos() ) ); }
bool XRect::touchEndedInternal( ci::app::TouchEvent::Touch touch ) { if (mScript) mScript->call("touchEnded", touch.getPos().x, touch.getPos().y); return true; }
TouchEvent::TouchEvent(ci::app::TouchEvent::Touch event, Type type) : mCiEvent(event) , mType(type) { mWindowPos = event.getPos(); }