Monday, July 11, 2022
HomeGame DevelopmentChange Sprite with a button - Cocos Creator

Change Sprite with a button – Cocos Creator


I’ve a sprite choice that’s sectioned that prompts a button after which I would really like it to alter the chosen sprite to a different sprite
Is it doable ?
I’ve a sprite choice that’s sectioned that prompts a button after which I would really like it to alter the chosen sprite to a different sprite
Is it doable ?

Listed here are some footage


sp.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(…);

Can’t you simply substitute it?

Sure certainly that’s what I wish to do, however I can’t and this piece of code you set there, I went this manner however I don’t fairly perceive

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments