cocos2d-x C++ 3.x ui::Button

  • DJEclipse
    Likes 0

    Problem Description

    I created a ui::Button and then I added a touchEventListener to it. I can use the following function to get when the touch began, moved, canceled, or ended.

    void HelloWorld::touchEvent(Ref * pSender, ui::Widget::TouchEventType type);

    Is there a way to get the position of the touch on the button as well?

  • Sonar Systems admin
    Likes 0

    When you say on the button do you mean relative to the button size or screen size?


    This reply has been verified.
  • DJEclipse
    Likes 0

    Relative to screen size but either one is okay.


    This reply has been verified.

Login to reply