MCPcopy Create free account
hub / github.com/axmolengine/axmol / onTouchesMoved

Method onTouchesMoved

tests/cpp-tests/Source/RendererTest/RendererTest.cpp:308–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308void NewClippingNodeTest::onTouchesMoved(const std::vector<Touch*>& touches, Event* event)
309{
310 if (!_scrolling)
311 return;
312 Touch* touch = touches[0];
313 auto clipper = this->getChildByTag(kTagClipperNode);
314 auto point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView()));
315 Vec2 diff = point - _lastPoint;
316 auto content = clipper->getChildByTag(kTagContentNode);
317 content->setPosition(content->getPosition() + diff);
318 _lastPoint = point;
319}
320
321void NewClippingNodeTest::onTouchesEnded(const std::vector<Touch*>& touches, Event* event)
322{

Callers

nothing calls this directly

Calls 7

getInstanceFunction · 0.85
convertToNodeSpaceMethod · 0.80
convertToGLMethod · 0.80
getChildByTagMethod · 0.45
getLocationInViewMethod · 0.45
setPositionMethod · 0.45
getPositionMethod · 0.45

Tested by

no test coverage detected