what getBoundingBox() would return if the node doesn't have a texture ?

  • pabitrapadhy
    Likes 1

    Problem Description

    Hello, 
    I would be very specific with my question.

    I have a Sprite without texture.
    If I am touching on the screen and checking, 

    if(sprite->getBoundingBox().containsPoint(touch->getLocation()))
    {
    return true;
    }

    I want to know whether touching will crash or what.. ??
    if the texture is not present.

    It’s kind of urgent and high priority.
    I would seek your help.

  • Sonar Systems admin
    Likes 0

    It would most likely crash, you could set a texture just with alpha.

  • pabitrapadhy
    Likes 1

    well, that would also do..

    I would set the opacity to 0 and set a conditon in the onTouchBegan()
    that if the sprite has opacity 0, then don’t take touch..

    Ha ha.. :)
    Simple right… why didn’t I thought so…
    Thank you very much for the quick response.


    This reply has been verified.
  • Sonar Systems admin
    Likes 0

    Your welcome :D

Login to reply