LiquidText example

February 11th, 2008 . by polyGeek

I’m about to rewrite my LiquidText class in AS3 but first I thought I’d apply some of the code optimizations to the AS2 version and add some API calls to adjust settings just in case someone wants to use it.

Here’s an example of it in action below [ download FLV | download LiquidText.as ]

Essentially, what LiquidText does is it takes the text that you give it and breaks it down into an array of the individual words. It then finds a place where it can put the first word within the area that you specify without hitting any of the shapes that it wraps around. Then it places the following words until it runs out of space on that line. Then it wraps to the next line and starts the process over again.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Digg
  • Facebook

5 Responses to “LiquidText example”

  1. comment number 1 by: Phillip Kerman

    Not bad, not bad… But… isn’t Flash Player 10 supposed to support this? Selecting more than one char or one word at a time too.

  2. comment number 2 by: polyGeek

    @Phillip, I’ve not heard of FP10 supporting this. I’ve heard about the right-left text and stuff but that’s about it.

    Do you know something I don’t? Actually, don’t answer that. You don’t have time to go into all the stuff you know that I don’t. :-)

  3. comment number 3 by: Jensa

    Hi Dan,
    Phillip is right and I got this confirmed from Mike Downey while he was in Oslo last week. They are doing a full rewrite of all text handling for the next version. I love this class though! Can the text “fall thrugh” and hourglass-like shape as well? That’d be a cool demo :)

  4. comment number 4 by: Ryan Stewart

    I thought Flash Player 10 was just going to make it easier to do this kind of thing. As I understood it we’re exposing the very low level text rendering APIs in the player and then building the layout engine on top of that in AS3. So developers will be able to extend what we write as well as add their own renderers for different languages.

    But I could be wrong.

    =Ryan
    rstewart@adobe.com

Leave a Reply

Name

Mail (never published)

Website

- Why ask? This confirms you are a human user!