We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laya版本:2.13.1 代码如下: Laya.stage.addChild(fairygui.GRoot.inst.displayObject); let tf = new fairygui.GBasicTextField(); tf.x = 400; tf.y = 200; tf.fontSize = 30; tf.color = "#ffff00"; tf.text = "2222222222"; fairygui.GRoot.inst.addChild(tf); let sp = new Laya.Sprite(); sp.graphics.drawRect(0, 0, 200, 300, "#ff0000"); Laya.stage.addChild(sp); Laya.timer.once(1000, this, () => { // tf.removeFromParent(); tf.visible = false; }); 首先保证是一个空项目 这个项目中只有一个fairygui的textfield实例,还有一个源生laya的Sprite,这个sprite是个红色矩形 两个都添加到舞台上,延时一秒移除textfield,或者将其visible设为false 大概再一秒过后这个红色矩形就会消失,从内存里看,sp还在,只是无法绘制出来 目录如果想让红色矩形存在,就需要new一个textfield放在那,并且要赋值文本(一个空字符串)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Laya版本:2.13.1
代码如下:
Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
let tf = new fairygui.GBasicTextField();
tf.x = 400;
tf.y = 200;
tf.fontSize = 30;
tf.color = "#ffff00";
tf.text = "2222222222";
fairygui.GRoot.inst.addChild(tf);
let sp = new Laya.Sprite();
sp.graphics.drawRect(0, 0, 200, 300, "#ff0000");
Laya.stage.addChild(sp);
Laya.timer.once(1000, this, () => {
// tf.removeFromParent();
tf.visible = false;
});
首先保证是一个空项目
这个项目中只有一个fairygui的textfield实例,还有一个源生laya的Sprite,这个sprite是个红色矩形
两个都添加到舞台上,延时一秒移除textfield,或者将其visible设为false
大概再一秒过后这个红色矩形就会消失,从内存里看,sp还在,只是无法绘制出来
目录如果想让红色矩形存在,就需要new一个textfield放在那,并且要赋值文本(一个空字符串)
QQ.20230312215915.mp4
The text was updated successfully, but these errors were encountered: