Switch image sprite on touch

  • tbruce
    Likes 0

    Problem Description

    Hi,

    I’ve been looking around and I can’t seem to find a way to switch an image when the screen is touched.  Is there a way to do that?

  • Sonar Systems admin
    Likes 0

    Have you got touch detection working?

  • tbruce
    Likes 0

    Yes the touch detection is working fine.  Can you switch image for the sprite in there on the fly?

  • Sonar Systems admin
    Likes 0

    Use the following code

     

    spriteName->setTexture( "ImagePathAndName.png" );
    

     

Login to reply