lufy's legend

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 4887|回复: 2
打印 上一主题 下一主题

LTextField不自动换行问题

[复制链接]

31

主题

0

好友

215

积分

帐下督

Rank: 2

跳转到指定楼层
楼主
发表于 2014-7-30 20:24:23 |只看该作者 |倒序浏览
代码如下,可是出现的效果并没有自动换行
var bg1 = null;
function onframe()
{
        if( bg1 == null )
        {
                mapLayer.removeAllChild();
                bg1= new LSprite();
                var txt = new LTextField();
                //txt.size=20;
                txt.setWordWrap=true;
                txt.width = 200;
                //txt.stroke = true;
                //txt.lineWidth = 1;
                //txt.lineColor = "#000000";
                txt.color="#000000";
                txt.text = "text\ntext\ntttttttttttttttttttttttttttttttttttttttttttttttttttt";
                txt.x = 0
                txt.y = 0;
                bg1.addChild(txt)
                mapLayer.addChild(bg1);
        }
}
回复

使用道具 举报

46

主题

3

好友

1866

积分

偏将军

Rank: 4

沙发
发表于 2014-7-30 20:36:16 |只看该作者
txt.setWordWrap = true;改为txt.setWordWrap(true)试试
回复

使用道具 举报

37

主题

8

好友

9312

积分

诸侯王

Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15

板凳
发表于 2014-7-30 22:27:41 |只看该作者
楼上正解,建议楼主多看看API文档,对照一下里面的代码例子,包括你的这个问题在内,大部分API都是有例子的。
不回答与技术和引擎不相关的问题
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

防止垃圾广告,请填写任意字符

Archiver|lufy's legend

GMT+8, 2024-5-3 01:48 , Processed in 0.044749 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部