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

Method onTouchesCommon

tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp:651–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649 }
650}
651bool Camera3DTestDemo::onTouchesCommon(Touch* touch, Event* event, bool* touchProperty)
652{
653 auto target = static_cast<Label*>(event->getCurrentTarget());
654
655 Vec2 locationInNode = target->convertToNodeSpace(touch->getLocation());
656 Size s = target->getContentSize();
657 Rect rect = Rect(0, 0, s.width, s.height);
658
659 if (rect.containsPoint(locationInNode))
660 {
661 *touchProperty = true;
662 return true;
663 }
664 return false;
665}
666bool Camera3DTestDemo::isState(unsigned int state, unsigned int bit) const
667{
668 return (state & bit) == bit;

Callers

nothing calls this directly

Calls 5

convertToNodeSpaceMethod · 0.80
RectClass · 0.50
getLocationMethod · 0.45
getContentSizeMethod · 0.45
containsPointMethod · 0.45

Tested by

no test coverage detected