How to make a sprite visible and invisible in Cocos2D ?

By | March 27, 2011

Hi,
In certain situations you may need to make visible or invisible certain sprites. But how to set a sprite visible and invisible in Cocos2D? See the following Cocos2D code.

//Set the sprite's visible value to 1 to make it visible
yourSprite.visible = 1;
//Set the sprite's visible value to 0 to make it invisible
yourSprite.visible = 0;

🙂

Leave a Reply

Your email address will not be published. Required fields are marked *