[]HTMLDivElement使用滤镜时显示异常
var text:HTMLDivElement = new HTMLDivElement();
text.style.lineHeight = 30;
text.style.color = color;
text.style.width = 500;
text.style.align = "center";
text.style.weight = "bold";
text.innerHTML = "中华人民共和国";
text.filters = [new GlowFilter("#000", 4, 2, 2)];
text.x = (ClientConfig.displayWidth-text.width)/2;
text.y = (ClientConfig.displayHeight-text.contextHeight)/2;
addChild(text);
加了滤镜后文字显示就不全,去掉滤镜就正常
text.style.lineHeight = 30;
text.style.color = color;
text.style.width = 500;
text.style.align = "center";
text.style.weight = "bold";
text.innerHTML = "中华人民共和国";
text.filters = [new GlowFilter("#000", 4, 2, 2)];
text.x = (ClientConfig.displayWidth-text.width)/2;
text.y = (ClientConfig.displayHeight-text.contextHeight)/2;
addChild(text);
加了滤镜后文字显示就不全,去掉滤镜就正常
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
ssqhu
赞同来自: reven1983
text.style.lineHeight = 30;
text.style.color = color;
text.style.align = "center";
text.style.weight = "bold";
text.innerHTML = "中华人民共和国";
text.filters = [new GlowFilter("#000", 4, 2, 2)];
text.style.width = 500;
text.x = (ClientConfig.displayWidth-text.width)/2;
text.y = (ClientConfig.displayHeight-text.contextHeight)/2;
addChild(text);
这是我们LayaAirIDE引擎的问题,谢谢提出。
临时解决方案将 text.style.width = 500; 放在设置滤镜之后。