-
Creator 版本: 2.4.2
-
目标平台: Chrome浏览器
-
重现方式:setScale 设置精灵节点无效,精灵图片没有放大或者缩小
试了下2.3.4的版本是可以放大缩小的。
测试代码如下:
const {ccclass, property} = cc._decorator;
@ccclass
export default class Helloworld extends cc.Component {
@property(cc.Label)
label: cc.Label = null;
@property(cc.Node) //这个是cocos的那个logo图片
uiTest: cc.Node = null;
@property
text: string = 'hello';
start() {
// init logic
this.label.string = this.text;
}
click() {//点击按钮放大图片
this.uiTest.scale += 1;
console.log("scale=" + this.uiTest.scale);
}
}
图片显示scale已经改变,但是那个logo还是原来的大小。
