Hi Erel,
The B4XCanvas DrawText method alignment property is either "LEFT", "CENTER" or "RIGHT".
These properties look like Strings.
But, this works:
xcvsGraph.DrawText(txt, Graph.Left - 0.6 * Texts.ScaleTextHeight, y + 0.38 * Texts.ScaleTextHeight, Texts.ScaleFont, ID.Color, "LEFT")
but this doesn't, tested with B4J:
Private Alignment = "LEFT" As String
xcvsGraph.DrawText(txt, Graph.Left - 0.6 * Texts.ScaleTextHeight, y + 0.38 * Texts.ScaleTextHeight, Texts.ScaleFont, ID.Color, Alignment)
Error:
java.lang.ClassCastException: java.lang.String cannot be cast to javafx.scene.text.TextAlignment
Wish, as the properties are Strings couldn't these be converted into the corresponding object in the library.
Or am I missing something.
Thank you in advance.
The B4XCanvas DrawText method alignment property is either "LEFT", "CENTER" or "RIGHT".
These properties look like Strings.
But, this works:
xcvsGraph.DrawText(txt, Graph.Left - 0.6 * Texts.ScaleTextHeight, y + 0.38 * Texts.ScaleTextHeight, Texts.ScaleFont, ID.Color, "LEFT")
but this doesn't, tested with B4J:
Private Alignment = "LEFT" As String
xcvsGraph.DrawText(txt, Graph.Left - 0.6 * Texts.ScaleTextHeight, y + 0.38 * Texts.ScaleTextHeight, Texts.ScaleFont, ID.Color, Alignment)
Error:
java.lang.ClassCastException: java.lang.String cannot be cast to javafx.scene.text.TextAlignment
Wish, as the properties are Strings couldn't these be converted into the corresponding object in the library.
Or am I missing something.
Thank you in advance.