'Draws a text
'Text = text to draw
'x = x coordinate of the reference point
'y = y coordinate of the reference point
'Font = text font name
'Paint = fx.Colors.Color
'HorizontalAlignment possible values: LEFT, CENTER, RIGHT
'VerticalAlignment possible values: TOP, CENTER, BASELINE, or BOTTOM
'Filled True for standard text False for empty text.
Public Sub DrawText3(cvs As Canvas, Text As String, x As Double, y As Double, Font As Font, Color As Paint, HorizontalAlignment As String, VerticalAlignment As String, Filled As Boolean)
Private Graph As JavaObject
Graph = cvs
Graph = Graph.RunMethod("getGraphicsContext2D", Null)
If Filled = False Then
Graph.RunMethod("setFont", Array As Object(Font))
Graph.RunMethod("setStroke", Array As Object(Color))
Graph.RunMethod("setTextAlign", Array As Object(HorizontalAlignment))
Graph.RunMethod("setTextBaseline", Array As Object(VerticalAlignment))
Graph.RunMethod("strokeText", Array As Object(Text, x, y))
Else
Graph.RunMethod("setFont", Array As Object(Font))
Graph.RunMethod("setFill", Array As Object(Color))
Graph.RunMethod("setTextAlign", Array As Object(HorizontalAlignment))
Graph.RunMethod("setTextBaseline", Array As Object(VerticalAlignment))
Graph.RunMethod("fillText", Array As Object(Text, x, y))
End If
End Sub