Is it possible to have a multiline TextObject?

Hi all,

First of all, where’s the documentation for the TextObject class? I can’t find it anywhere.

Second, is it possible to encourage it to bother with \n? I use the following mundane debug output function and I can’t get it to work. In some platforms you have to enable some multiline attribute for text objects, but if I can’t find the description of the TextObject, that complicates. Sorry if I’ve missed it in some obvious place (I use the beta btw)

[code]local debugTextObject = nil
local debugTextArr = {}
function LOG(str)
if not debugTextObject then
debugTextObject = display.newText ("", 40, 40, native.systemFont, 12)
debugTextObject:setTextColor (255,255,255)
end

if (3 == #debugTextArr) then
table.remove(debugTextArr, 1)
end

table.insert (debugTextArr, str)

debugTextObject.text = table.concat (debugTextArr, “.\n”)
end[/code]
[import]uid: 4441 topic_id: 1117 reply_id: 301117[/import]

Hi,

first look into the API guide page 36. It is described there. It shares the same common properties like the other display objects.

For multiline text display you can either use the native Textbox or see if the code by Gilbert at the end of this topic will help you:

http://developer.anscamobile.com/forum/2009/12/27/multiline-text#comment-2435

Michael Hartlef

http://www.whiteskygames.com
http://www.twitter.com/mhartlef [import]uid: 5712 topic_id: 1117 reply_id: 2864[/import]

Hi Mike,

Thanks! It seems borked in 2.0beta but I’ll give it a shot in future versions.

Thanks,
Marcus [import]uid: 4441 topic_id: 1117 reply_id: 2866[/import]