您的位置:首页 > 其它

flash 游戏设计笔记:静止复制粘贴(不用TextArea)

2011-02-12 11:15 453 查看
private static function vBoxPane(_x:int,_y:int,_w : int, _h : int) : VBoxPane {
var vboxPane : VBoxPane = new VBoxPane;
SpriteUtil.setScrollPaneStyle(vboxPane);
vboxPane.setStyle("upSkin", new Sprite);
vboxPane.move(_x,_y);

vboxPane.width = _w;
vboxPane.height = _h;

vboxPane.horizontalScrollPolicy="off";
vboxPane.paddingBottom=10;
vboxPane.paddingTop=0;

return vboxPane;
}
public static function getTextField(_w:int):TextField{
var format : TextFormat = new TextFormat();
format.font = "宋体";
format.size = 12;
format.color = 0xffffff;
format.align = TextFormatAlign.LEFT;
format.leading = 10;

var contentText:TextField = new TextField();
contentText.setTextFormat(format);
contentText.width =_w;
contentText.multiline = true;
contentText.wordWrap = true;
contentText.height = 3000;

//			contentText.height = contentText.bottomScrollV * 16;
contentText.selectable = false;
return contentText;
}
测试Main

vboxPane = SpriteUtil.getScrollPane(17,160+37,390,80);
this.addChild(vboxPane);

contentText = SpriteUtil.getTextField(vboxPane.width-20);
contentText.htmlText = desc;
contentText.height = contentText.bottomScrollV * 16;
vboxPane.addChild(contentText);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: