matb
matb

Reputation: 174

Is there a way to add text to sprite or movieclip not using TextField class?

Is there a way to add text programmatically in as3 to a Sprite or a MovieClip without using the class TextField

TextField inherits from InteractiveObject which is kind of heavy for what I want to do: just display text (i.e. I don't want to interact with the text).

Note: I'm aware that there is a property selectable to make the textfield not selectable. This is not the point.

Thank you

Upvotes: 1

Views: 1008

Answers (1)

Allan
Allan

Reputation: 3314

There are two ways that come to mind. The first being this whereby a string is written to bitmap data: How to draw a string on BitmapData

Second, you could try this fast font rendering library (although I have not tried it myself) lab.polygonal.de/2009/12/15/font-rendering-with-the-fp10-drawing-api/

Both these solutions seem to bypass the need for creating a textfield (except the first where it gets used to create but then is discarded).

Upvotes: 5

Related Questions