1.4.2版本下 如果button的transilation为scale,在代码中无法更改button的资源。
不管是button.getcomponent(cc.sprite).spriteframe=xxxxx;还是button.normalsprite=xxx都无效
ps:调试中button中的spriteframe被赋值后确实改变了名字
(请无视小写)
1.4.2版本下 如果button的transilation为scale,在代码中无法更改button的资源。
不管是button.getcomponent(cc.sprite).spriteframe=xxxxx;还是button.normalsprite=xxx都无效
ps:调试中button中的spriteframe被赋值后确实改变了名字
(请无视小写)
自己顶下
我刚刚测试了一下没啥问题,能否给一个 demo?
亲,你的代码写错了,应该是开头是小写的 spriteFrame 不是大写的,你修改以后可以测试看看是否 OK
this.button.getComponent(cc.Sprite).spriteFrame = this.sfList[this._num]
握草…
thanks