加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flash文字效果

发布时间:2020-12-15 07:06:19 所属栏目:百科 来源:网络整理
导读:flash中加入文本,使用了消除锯齿:可读性消除锯齿。发现不嵌入字体的无法动态修改里面的文字,但嵌入字体的话会造成swf文件过大。 最终还是选择了使用设备字体,并选择了黑体。出了一个问题,文字没有加粗效果,样式无法选择bold。通过as3.0代码解决的这个

flash中加入文本,使用了消除锯齿:可读性消除锯齿。发现不嵌入字体的无法动态修改里面的文字,但嵌入字体的话会造成swf文件过大。

最终还是选择了使用设备字体,并选择了黑体。出了一个问题,文字没有加粗效果,样式无法选择bold。通过as3.0代码解决的这个问题。

必须在设置完text后再setTextFormat才有效。


var txtFormat:TextFormat = new TextFormat();
txtFormat.font = "黑体";
txtFormat.size = 22;
txtFormat.bold = true;
txtFormat.color= 0xFFFF00;

var sName:String = stage.loaderInfo.parameters['nickname']; if(sName) { nickname.text = sName.slice(0,12); nickname.setTextFormat(txtFormat); } var sReward:String = stage.loaderInfo.parameters['reward']; if(sReward) { reward.text = ?"""+ sReward.slice(0,12) +"""; reward.setTextFormat(txtFormat); }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读