Skip to main content
Inspiring
May 25, 2010
Answered

TextFlow inside a Resizable Container

  • May 25, 2010
  • 1 reply
  • 967 views

Hi,

I've been looking for a solution for an issue for a while and hope someone can help me here.

I have a TextFlow rendered in a Sprite. The sprite is inside a resizable container. When the container is resized, the new sprite size is update in the container controller. The problem is that the text is been deformed.

This is an image of the text before been scaled.

And this one is after been scaled:

I'm not changing the the font size or anything else, just width and height of the sprite.

Any ideas?

This topic has been closed for replies.
Correct answer robin_briggs

Rather than changing the width and height of the Sprite (which causes a graphic scaling), instead, change the width and height of the text in the container. If you have just one container for the text flow, it might look something like this:

     textFlow.flowComposer.getControllerAt(0).setCompositionSize(newWidth, newHeight);

That resizes the area into which the text flows.

- robin

1 reply

oscar7878Author
Inspiring
May 25, 2010

Here's more information about this issue.

When the parent container is scaled by the user, this is how I'm updating the TextFlow:

textFlow.flowComposer.removeAllControllers();

var newPageController:ContainerController = new ContainerController( container, w, h );

var controllerFormat:TextLayoutFormat = new TextLayoutFormat();

newPageController.format = controllerFormat;

textFlow.flowComposer.addController( newPageController );

Any comments will be appreciated.

oscar7878Author
Inspiring
May 25, 2010

Here is a short video that shows the issue:

http://www.oscar-mejia.com/assets/videos/resizeIssue.m4v