I've been playing this for a while and I can't figure out what I'm doing wrong. When I am using DrawText2 on a canvas, the text is being compressed to fit within the "MaxWidth" parameter, rather than being wrapped onto multiple lines. For example:
The output is:
Suggestions?
B4X:
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 400
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.SetFormStyle("UNIFIED")
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
Dim poCan As Canvas
poCan.Initialize("")
MainForm.RootPane.AddNode(poCan, 0, 0, MainForm.Width, MainForm.Height)
MainForm.RootPane.Style = "-fx-background-color:#000000;"
Dim poFnt As Font = fx.CreateFont("Verdana", 30, False, False)
poCan.DrawText2("This is a long line of text that should be wrapped due to the size limit applied.", 10dip, 100dip, poFnt, fx.Colors.White, "LEFT", 150dip)
End Sub
The output is:
Suggestions?