AS2中通过镶嵌字体设置动态文本旋转度

最近在网上看到关于设置动态文本对象的旋转度(或文本对象的父级MC旋转度)以后,文本消失的问题。这个是需要镶嵌字体的,简单整理一下实现方法。

环境是Flash 8 和ActionScript 2.0。

如果是手动在舞台上绘制的文本框,直接在属性面板中镶嵌入字体就可以。这里主要讲一下通过代码创建的文本对象设置的方法。

1,选择添加新的字体:

1.gif

2,将要嵌入的字体选择进去

2.gif

3,然后设置字体符号的连接标识符

3.gif

4,在你需要的地方写代码:

[code lang="actionscript"]

// create a new TextField
this.createTextField("t", 0, 100, 100, 100, 100);
// set embed font enable, and set Text string
t.embedFonts = true;
t.text = "wahAHAHAsadf";
// set a new TextFormat to TextField with the Font symbol in library
var ft:TextFormat = new TextFormat();
ft.font = "A";
t.setTextFormat(ft);
// set rotation now~
t._rotation = 45;

[/code]

5,编译,效果:

4.gif

补充说明:如果要设置动态文本的alpha属性,也需要使用这样的方法来嵌入字体。

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Hello world

Hi,我是Tang Bin,finalbug.org是我的个人站点。这里有更多关于我的内容。English readers please click here to learn more about me and this site.

Categories