laviniut Active Member Licensed User Longtime User Jul 16, 2014 #1 How can i use canvas drawtext with multiline ?
klaus Expert Licensed User Longtime User Jul 16, 2014 #2 You must use the CRLF character in your string to force a next line. B4X: txt = "This is the first line." & CRLF & "This is the second line." & CRLF & "This is the third line." Canvas1.DrawText(txt, .... Upvote 0
You must use the CRLF character in your string to force a next line. B4X: txt = "This is the first line." & CRLF & "This is the second line." & CRLF & "This is the third line." Canvas1.DrawText(txt, ....
laviniut Active Member Licensed User Longtime User Jul 16, 2014 #3 I use B4X: txtbtnbattery = "Battery," & CRLF & "Time and Date" Canv.DrawText(txtbtnbattery, 120, 623, Typeface.DEFAULT_BOLD, 18, Colors.White, "CENTER") and is not working. Is on o single line and CRLF is a little square. Upvote 0
I use B4X: txtbtnbattery = "Battery," & CRLF & "Time and Date" Canv.DrawText(txtbtnbattery, 120, 623, Typeface.DEFAULT_BOLD, 18, Colors.White, "CENTER") and is not working. Is on o single line and CRLF is a little square.
MaFu Well-Known Member Licensed User Longtime User Jul 16, 2014 #4 Canvas.DrawText() is single line only. You must handle the multiline draw for yourself. Upvote 0
klaus Expert Licensed User Longtime User Jul 16, 2014 #5 Sorry, I thought that it should work. So, unfortunately, you need to draw each line. Upvote 0
laviniut Active Member Licensed User Longtime User Jul 16, 2014 #6 Yes, i drawn each line and is ok. Upvote 0
MaFu Well-Known Member Licensed User Longtime User Jul 16, 2014 #7 I posted a multiline example in "Code Snippets": link Upvote 0