Created
May 25, 2012 06:29
-
-
Save liekkas/2786164 to your computer and use it in GitHub Desktop.
FLEX:VerticalText 竖直文字排行效果
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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