Skip to content

Instantly share code, notes, and snippets.

@liekkas
Created May 25, 2012 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liekkas/2786164 to your computer and use it in GitHub Desktop.
Save liekkas/2786164 to your computer and use it in GitHub Desktop.
FLEX:VerticalText 竖直文字排行效果
package
{
import flash.display.Sprite;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.conversion.TextConverter;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.BlockProgression;
import flashx.textLayout.formats.TextLayoutFormat;
public class VerticalText extends Sprite
{
public function VerticalText()
{
var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
textLayoutFormat.lineHeight = 30;
textLayoutFormat.locale = 'zh';
textLayoutFormat.blockProgression = BlockProgression.RL;
var text:String = "测试竖向文字,再看看English如何?";
var textFlow:TextFlow = TextConverter.importToFlow(text, TextConverter.PLAIN_TEXT_FORMAT);
textFlow.hostFormat = textLayoutFormat;
textFlow.flowComposer.addController(new ContainerController(this, 25, 200));
textFlow.flowComposer.updateAllControllers();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment