2016-10-13 00:16:48 点击量:11 标签: 收藏本文
[AS3]as3文本的竖排写法示例
- var _textFiled:TextField = new TextField();
- _textFiled.text = "横排or竖排";
- _textFiled.wordWrap = true;
- _textFiled.selectable = false;
- _textFiled.antiAliasType = AntiAliasType.ADVANCED;
- addChild(_textFiled);
- _textFiled_textFiled.text = _textFiled.text.split("").join("\n");
- var fontDescription:FontDescription=new FontDescription("宋体");
- var format:ElementFormat = new ElementFormat();
- format.fontSize = 32;
- format.color = 0xfffff;
- format.textRotation = TextRotation.AUTO;
- format.fontDescription=fontDescription;
- var textElement:TextElement=new TextElement("",format);
- var textBlock:TextBlock = new TextBlock();
- textBlock.content=textElement;
- textBlock.lineRotation=TextRotation.ROTATE_90;
- var linePosition:Number=0;
- var previousLine:TextLine=null;
- while (true) {
- var textLine:TextLine = textBlock.createTextLine(
- previousLine,
- 180);
- if (textLine==null) {
- break;
- }
- textLine.y=20;
- textLine.x=linePosition;
- linePosition-=25;
- addChild(textLine);
- previousLine=textLine;
- };
- _textFiled_textFiled.text = _textFiled.text.split("\r").join("");
我们是一家提供综合软件外包与弱电工程服务的技术公司。
业务涵盖定制软件、管理系统、网站、小程序、APP、系统集成、网络布线、监控安防、门禁、机房建设及长期技术维护。
公司地址:湖北省宜昌市伍家岗区东站二路6号三峡(宜昌)大数据产业园海洋馆二楼A203室