如何扩展一个动态文本在Flash中使用AS3中心点? [英] How do you scale a dynamic textfield in flash from the center point using as3?

查看:135
本文介绍了如何扩展一个动态文本在Flash中使用AS3中心点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使一个文本的效果,即在每帧中的文本框的大小增加及减少的不透明度。我用我的动态文本的scaleX和scaleY属性放大,但它这样做保持左报名点固定。我希望把它扩大径向向外,或中心点固定。谁能告诉我如何做到这一点?

I'm trying to make a text effect where on every frame the textfield increases in size and decreases in opacity. I'm using the scaleX and scaleY properties of my dynamic textfield to enlarge, but it's doing so keeping the left registration point fixed. I want to make it scale up radially outward, or with the center point fixed. Can anyone tell me how to do this?

推荐答案

您可以轻松创建一个包装的文本字段(即包含文本字段)执行注册点到中间。如果文本字段是动态的,以确保它的的autoSize 设置为。然后你可以设置它的 X / Y 位置 -textField.width * 0.5 / -textField.height * 0.5 。当然缩放应该应用到母体。

You can easily create a wrapper for the TextField (i.e. a Sprite containing the TextField) to enforce the registration point to the middle. If the TextField is dynamic make sure it's autoSize is set to LEFT. Thereafter you can just set it's x/y position to -textField.width*.5/-textField.height*.5. Of course the scaling should be applied to the parent.

这篇关于如何扩展一个动态文本在Flash中使用AS3中心点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆