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

    技术2025-04-29  23

    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);

    最新回复(0)