AS3 - 呈现文本直Sprite.graphics? [英] as3 - render text straight to Sprite.graphics?

查看:338
本文介绍了AS3 - 呈现文本直Sprite.graphics?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我是一个可怕的,坏的人谁喜欢做不同的事情没有任何理由, 我很想能够做到像mySprite.graphics.drawText(...)。

Because I'm a terrible, bad person who likes to do things differently for no reason, I'd love to be able to do something like mySprite.graphics.drawText(...).

据我了解的事情,目前得到的文本的唯一方法是创建一个文本字段并将其添加为MySprite的的孩子。在我的特殊情况下,我宁愿不要做。

As I understand things, the only way to get text currently is to create a TextField and add it as a child of mySprite. In my particular situation I'd rather not do that.

任何意见AP preciated!

Any advice appreciated!

噢噢

推荐答案

如果你想要把它包在雪碧的方法,我想简单地扩展了Sprite类,函数的drawText添加到它。在该方法中添加文本字段等,但它听起来并不像你想的。

If you wanted to wrap it up in a method of Sprite I would simply extend the Sprite class, add the function drawText to it. Within that method add the TextField etc. But it doesn't sound like you want that.

在这种情况下,看看这里 http://lab.polygonal.de/?p=916

In which case have a look here http://lab.polygonal.de/?p=916

他们已经创造了code的集合,它可以使字体没有,好,字体。有像文件大小的缺点,但它是可能的。

They have created a collection of code that can render fonts without, well, fonts. There are disadvantages like file size, but it is possible.

这篇关于AS3 - 呈现文本直Sprite.graphics?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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