最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
flash as TextField设置不同字体和颜色方法总结
时间:2022-06-28 22:15:39 编辑:袖梨 来源:一聚教程网
有时候,我们想对TextField中设置不同的字体和颜色,应该怎么办呢?其实,利用htmlText就可以轻松做到:
| 代码如下 | 复制代码 |
| var tmp_text:TextField=new TextField(); tmp_text.width=300; tmp_text.htmlText="Formatted textFormatted text"; addChild(tmp_text); |
|
提示:采用这种方法就不能开始制定TextField的字体,也不能使用TextFormat去设置字体啦,否则就失效了
如何在同一个TextField中设置不同的字体样式
例
| 代码如下 | 复制代码 |
|
var mytext:TextField=new TextField(); function getTF(n:uint):TextFormat |
|
例
1.
| 代码如下 | 复制代码 |
|
Font.registerFont(Arial);//这句是将Arial字体注册到全局,如果你只在本文件中使用字体就不用写, |
|
2.
| 代码如下 | 复制代码 |
|
var fontlist= Font.enumerateFonts(); t1.embedFonts = true; asdas dasdas ’; |
|
相关文章
- 风帆纪元官网入口-风帆纪元官网首页入口 03-19
- 免费视频软件有哪些-国外网红专用拍视频工具 03-19
- 这城有良田李令月技能加点推荐 03-19
- 受欢迎的nba2k手游大全 2026人气较高的nba2k游戏合集 03-19
- FLiNG-Trainer官网_FLiNG-Trainer中文修改器 03-19
- 三国百将牌吕蒙技能玩法介绍 03-19