在Corona中将文本对齐到左侧

我的问题是我无法将文本对齐到左侧。我需要设置一个文本的起始位置,并使其向左对齐而不居中。就像在 HTML 中一样,您可以设置位置,它会从该位置向右移动,最终另起一行。或许一个图片示例会让你更好地理解,因为很难用语言来描述。

它应该是什么样子,以及在哪里应该始终显示起始位置,如果我添加更多文本,它应该继续向右移动。

How it should look and where it should start all the time

如果我添加更多文本,它会变成这样,而这不是我想要的。

How it looks if i add more text, and thats not how i want it

以下是一些代码:

    text = display.newText("Fair", 0, 0, "HelveticaNeue-Light", 22)
    text.x = halfW - 300
    text.y = halfH + 110
    text.align = "left"
点赞
用户1607767
用户1607767

你正在使用当前的公共版本(2014.2100)吗?

尝试使用 text.anchorX = 0 替代 text.align = "left"。 所以 anchorX = .5 相当于 "middle",而 anchorX = 1 相当于 "right"。

2014-04-30 02:23:43